Dave1201 Dave1201 - 2 years ago 110
iOS Question

Set an UIImage to an Imageview Swift

Just started coding and i am running in to the following problem:

I have set up the following struct:

Connected the UIImageView as: @IBOutlet var Qimage: UIImageView!

I tried to fill the struct, and all the data is displayed correctly except the image? Example:

At last i am trying to fill the struct with a function and used: Qimage.image = Questions[Qnumber].Image

Thanks in advance for the help!

Answer Source

Use: UIImage(named: "Test").. instead of UIImage(contentsOfFile: "Test")

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download