So I have been going through my code over and over and searching online for a solution to this problem and I am stuck. Nothing that I can find online has any information on why the screen would load and then turn black. The code modally presents another view that has a UIImageView inside of it. There is an image (.png file) that should be loading in the image view and you can see the image while the view is being presented modally, but as soon as the view slides into place the whole view turns black. Also you can see the image in the storyboard and it shows it correctly, it is only in the simulator where the image immediately turns black.
Here is the code of the view controller that is presented:
import UIKit
class MenuViewController: UIViewController
{
@IBOutlet var imageView: UIImageView!
override func viewDidLoad()
{
super.viewDidLoad()
// Do any additional setup after loading the view
let backgroundImage: UIImage! = UIImage(contentsOfFile: "behind_alert_view.png")
imageView.image = backgroundImage;
}
}
I also tried using the function UIImage(named: "behind_alert_view.png"). Any help would be greatly appreciated!