How does animateAlongsideTransition work?
This is my part of my subclass 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)
}
}
The problem is I can't see yellow even for a millisecond. What for? What does it mean with the transition? What is the transition? My transition time is set UIViewControllerAnimatedTransitioning
up to 5 seconds .
If I remove my line A then I only see yellow and everything is fine. Why doesn't this animation (yellow to green) take 5 seconds?
+3
source to share
No one has answered this question yet
Check out similar questions: