There are 3 UIViewControllers under NavigationController and tabBarController.
Push the viewControllers like this: A->B->C
In viewController C, add the following codes to let user to select image from photo library.
func btnClicked() {
let imagePickerController = UIImagePickerController()
imagePickerController.sourceType = .photoLibrary
imagePickerController.delegate = self
self.present(imagePickerController, animated: true, completion: nil)
}
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) {
if let image = info[UIImagePickerControllerOriginalImage] as? UIImage{
topIamge.image = image
}
picker.dismiss(animated: false, completion: nil)
}
Problem is that after the user select an image or cancel the selection, then press the left bar button going back to B, an error Unbalanced calls to begin/end appearance transitions for
shows up, if continue going back to A, the error is printed out again.
Did I make anything wrong?
P.S. There is no error if I press the back button without presenting UIImagePickerController.
Thx.