在控制器之间的转换时刻,我有一些小的黑色闪烁。
在我显示它之前,我必须向新控制器加载很多东西,然后我传递一些名为" Art"的UIImage
参数。
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let controller:ModelController = storyboard.instantiateViewController(withIdentifier: "ModController") as! ModelController
controller.artwork=art //pass this to load the new
let transition = CATransition()
transition.duration = 0.30
transition.type = kCATransitionPush
transition.subtype = kCATransitionFromRight
view.window!.layer.add(transition, forKey: kCATransition)
present(controller, animated: false, completion: nil)
在新控制器上,我在之后加载所有内容:
override func viewDidLoad() {
super.viewDidLoad()
//load scroller here