Beginning iOS Animations - Part 21: Section 3: | Ray Wenderlich

Learn about view controller transitions and why you should consider customizing them with unique animations in your apps.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/4416-beginning-ios-animations/lessons/21

At the end of the video, you added to PopAnimator, inside UIView.animate:

if !self.presenting {
    let viewController = transitionContext.viewController(forKey: .to) as! ViewController
    viewController.selectedImage!.isHidden = false
}

However, when practicing before your video, I simply added a single line to the ViewController and this had the same result

func animationController(
    forDismissed dismissed: UIViewController
    ) -> UIViewControllerAnimatedTransitioning? {
    transition.presenting = false
   ->  selectedImage?.isHidden = false
    return transition
}

Any reason, longer term mine idea might hit issues or conflicts?

@catie Can you please help with this when you get a chance? Thank you - much appreciated! :]