I am trying to add a UIImage to a UIImageView in Swift as of March 2019. The image is titled correctly and is saved in the iCloud Drive in the same directory as the Swift file. I am able to add the UIImageView to a view controller perfectly fine but the image does not show up in it. I believe I have the right file name as I copied it directly from the finder. What I want to do is have an image inside of a viewer which is scaled by aspect ratio to fit the viewer.
let discoverIcon = UIImage(named: "DiscoverButtonIcon.png")
let discoverImageView = UIImageView(frame: CGRect(x: 200, y: 200, width: 100, height: 100))
discoverImageView.image = discoverIcon
discoverImageView.contentMode = .scaleAspectFit
view.addSubview(discoverImageView)
This is what I have tried to do but the UIImage will not show up.