在我的截图中,我的故事板的结构是UITabBarController
- > UINavigationController
- > UIViewController
。在我的UIViewController
中,我使用.Camera
中的UIImagePickerController
来致电viewDidLoad
。但是,当用户在相机内点击取消时,我会关闭ViewController,而我的标签栏会消失!
这是我的解雇代码:
func imagePickerControllerDidCancel(picker: UIImagePickerController) {
dismissViewControllerAnimated(true, completion: nil)
}
编辑:添加了对UIImagePickerController的调用
override func viewDidLoad()
{
super.viewDidLoad()
let picker = UIImagePickerController()
picker.delegate = self
picker.sourceType = .Camera
presentViewController(picker, animated: true, completion: nil)
}