andreamazz / BubbleTransition

A custom modal transition that presents and dismiss a controller with an expanding bubble effect.
MIT License
3.32k stars 250 forks source link

Segue To Storyboard Reference #25

Closed acegreen closed 8 years ago

acegreen commented 8 years ago

Hello,

I came across an issue where I refactored my storyboard and am using a storyboard reference. My segue is identical to what it was when I had my VCs in the same storyboard and the transition worked.

Now the bubble transition is not honored and the segue is performed as a regular modal . prepareForSegue is being called and has the following:

if segue.identifier == "FeedbackSegueIdentifier" {            
            let controller = segue.destination
            controller.transitioningDelegate = self
            controller.modalPresentationStyle = .custom
}

With the new storyboard reference I have tried two options

  1. Reference to the storyboard and add an intial point of entry
  2. Reference the specific UINavigationController in my storboard reference (Reference ID)

Both ignored the transition

screen shot 2016-09-04 at 11 13 54 am
acegreen commented 8 years ago

Here is a quick video.

Note: The segue dimisses in a fade like motion which seems to indicate that the dismiss segue works at least somewhat

http://recordit.co/VhRKXOf4BY

acegreen commented 8 years ago

Ah resolved. Migration to Swift 3 caused the method to be named different. The VC still adhered to the UIViewControllerTransitioningDelegate because all methods are optional

@andreamazz maybe consider making the two methods below non-optional?

For future reference

Incorrect method names

    func animationController(forPresentedController presented: UIViewController, presenting: UIViewController, sourceController source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    }
    func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    }

Correct method names

    func animationController(forPresented presented: UIViewController, presenting: UIViewController, source: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    }
    func animationController(forDismissed dismissed: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    }
andreamazz commented 8 years ago

The method are define as optionals in UIKit's UIViewControllerTransitioningDelegate, I can't do anything about it 😬

The method names looks correct to me in the current master branch.