I have an image from the Images.xcassets
folder and I want to load it into a UIImage
programmatically using swift. How can I do this? Anyone done this before? Please give me some code examples!
UIImage contains the data for an image. UIImageView is a custom view meant to display the UIImage .
Here's my code:
@IBOutlet weak var imageView: UIImageView! override func viewDidLoad() { super.viewDidLoad() imageView.image = UIImage(named: "Apple") }
I created an image view and displayed an image inside it.
Enjoy coding!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With