Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Swift 动画长边过渡是如何工作的?_Swift_Ios8_Uiviewanimationtransition - Fatal编程技术网

Swift 动画长边过渡是如何工作的?

Swift 动画长边过渡是如何工作的?,swift,ios8,uiviewanimationtransition,Swift,Ios8,Uiviewanimationtransition,这是我的UIPresentationController子类的一部分: override func presentationTransitionWillBegin() { if let containerView = containerView { dimmingView.frame = containerView.bounds dimmingView.backgroundColor = UIColor.yellowColor() con

这是我的
UIPresentationController
子类的一部分:

override func presentationTransitionWillBegin() {

    if let containerView = containerView {
        dimmingView.frame = containerView.bounds
        dimmingView.backgroundColor = UIColor.yellowColor()
        containerView.insertSubview(dimmingView, atIndex: 0)

        presentedViewController.transitionCoordinator()?.animateAlongsideTransition({ context in

            self.dimmingView.backgroundColor = UIColor.greenColor() //line A

            }, completion: nil)
    }
}
问题是,我甚至一毫秒都看不到黄色。为什么?过渡期旁边的是什么意思?什么过渡期?我的转换持续时间设置为
UIViewControllerAnimatedTransitioning
5秒


如果我删除我的行A,那么我只能看到黄色,这是正常的。为什么此动画(从黄色到绿色)不占用我的5秒钟?

您找到了解决方案吗?我也有同样的问题,我还没有发现。