我有一个UIViewController
我有一个按钮,可以打开UIImagePickerController
。
我想要实现的是无缝从UIImagePickerController
过渡到第二个UIViewController
。
我试过了
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
picker.dismissViewControllerAnimated(true, completion: {
self.performSegueWithIdentifier("toSecondVC", sender: nil)
}
}
我也试过
func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
picker.dismissViewControllerAnimated(true, completion: {
let secondView = self.storyboard?.instantiateViewControllerWithIdentifier("secondView")
self.presentViewController(secondView!, animated: true, completion: nil)
}
}
两者都给出了相同的结果,基本上当我关闭UIImagePickerController
时,它会在很短的时间内显示第一个视图控制器,然后转换到第二个视图控制器。
如何摆脱显示第一个视图控制器的那个短暂时刻?