I am working on a camera iOS application using swift. I'm segueing an image to a view(uploadView) and displaying it using that image on the in camera but when I press the cancel on the camera and return to the view(uploadView) the segued image disappears. Already tried storing that image in a new UIImage variable but for some reason still remains empty after pressing cancel or going back to that view(uploadView). I'm not sure if there is any other way to store the image when the view loads for the first time and keep the image there.
//for my view where I am displaying the image
override func viewDidLoad() {
super.viewDidLoad()
uploadImage.image = firstImageInSecondView
UILabel.text = String(Int(50.0))
}
// this is what I am trying to show the image again
func imagePickerControllerDidCancel(_ picker: UIImagePickerController) {
dismiss(animated: true, completion: nil)
uploadImage.image = firstImageInSecondView
print(uploadImage.isHidden)
}
Output is false.