从 xib 视图到 ViewController 的动画 segue

Animated segue from xib view to ViewController

我有一个名为 thirdView.xib 和 "allPicsViewController" 的视图(因此没有 Storyboard Segue)。我的问题是,如果可以执行动画 segue(Cross Dissolve 是最好的),而不是从底部开始的普通动画。

此代码显示了我的 "allPicsViewController" 并且它有效,但视图从底部开始动画。

func showProfileController(){  
        let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
        let vc: UIViewController = storyboard.instantiateViewControllerWithIdentifier("allPicsViewController")
        self.presentViewController(vc, animated: true, completion: nil)

        print("btn tapped")       
    }

我也试过设置 animated:false ,但效果不佳。 谢谢

来自我上面的评论(帮助其他人):

刚刚设置

vc.modalTransitionStyle = UIModalTransitionStyle.CrossDissolve 

在呈现视图控制器之前。