从UIImagePickerController到UIViewController的无缝转换

时间:2016-04-04 21:42:29

标签: ios swift uiviewcontroller uiimagepickercontroller

我有一个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时,它会在很短的时间内显示第一个视图控制器,然后转换到第二个视图控制器。

如何摆脱显示第一个视图控制器的那个短暂时刻?

0 个答案:

没有答案
相关问题