animateAlongsideTransition如何运作?

时间:2015-07-28 12:27:35

标签: swift ios8 uiviewanimationtransition

这是我的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秒钟?

0 个答案:

没有答案
相关问题