I simply would like to display an image which is part of the app.
When executing the following code, my image is nil
.
let image = UIImage(named: "back.png");
The "back.png" is stored in my "Images.xcassets"
folder of my project.
How to load the image from within the app folders?
(Loading the Image from a path is working for me, but I do not know how to reference an image stored in the project itself)
With the latest Xcode 8.3 its much easier to adding any image, Using Image Literal option.
Just select any image from assets.
let image = //type and select Image Literal option, and select image from as per below reference
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