AladinWay / TransitionButton

UIButton sublass for loading and transition animation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Navigation Controller transition

opened this issue · comments

Hello, the transition animation not working well with Navigation controller ..
tried to present it like this but not working:

                          let storyboard = UIStoryboard(name: "Main", bundle: nil)
 let navController = storyboard.instantiateViewController(withIdentifier: "FinalBuy") 
 as!FinalBuyViewController
                            self.present(navController, animated: true, completion: nil)

the effect is now working but the navigation bar is not showing .. any solutions guys ?

Thanks for using TransitionButton project. Can you please provide more context and steps to reproduce the issue ?

i'm just trying to present the animation with navigation controller its
going like this :

ViewController (A) -> Navigation controller -> View controller (b)

when then expand effect is going to VC (b)
inside alert.addAction(.init(title: "OK", style: .default, handler: { (action) *in* sender.stopAnimation(animationStyle: .expand, revertAfterDelay: 3) {

                        let storyBoard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
                        let mynavigationController = storyBoard.instantiateViewController(withIdentifier: "FinalBuy") as! UINavigationController
                        let vc = mynavigationController.topViewController as! FinalBuyViewController
                        self.navigationController?.present(vc, animated: true, completion: nil)`

i get the exception :
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller <UINavigationController: 0x10d034c00>.'

It seems like it's an issue not related to TransitionButton. You are trying to present a ViewController which already active https://stackoverflow.com/questions/7429014/application-tried-to-present-modally-an-active-controller