uinavigationcontroller - NavigationController.pushViewController in Custom Segue does not work - Swift 2.0 - iOS 9.1 -
i'm writing custom segue in uistoryboardsegue. use catransition create right left custom animation. if used sourceviewcontroller.navigationcontroller?.pushviewcontroller(destinationviewcontroller, animated: false);
, not take me second view. performs right left animation , stays on first view. have debugged code, , found sourceviewcontroller.navigationcontroller nil. have uinavigationcontroller between first view , second view.
i have tried replace line of code sourceviewcontroller.presentviewcontroller(destinationviewcontroller, animated: false, completion: nil);
. transition happen, happens fast can't see right left animation.
my complete code in uistoryboardsegue following:
override func perform() { let sourceviewcontroller = self.sourceviewcontroller uiviewcontroller; let destinationviewcontroller = self.destinationviewcontroller uiviewcontroller; let transition: catransition = catransition() transition.duration = 0.25; transition.timingfunction = camediatimingfunction(name: kcamediatimingfunctioneaseineaseout) transition.type = kcatransitionpush; transition.subtype = kcatransitionfromright; sourceviewcontroller.view.layer.addanimation(transition, forkey: "kcatransition") sourceviewcontroller.navigationcontroller?.pushviewcontroller(destinationviewcontroller, animated: false); }
thank help
using sourceviewcontroller.pushviewcontroller
correct. reason getting nil sourceviewcontroller.navigationcontroller
that, placed navigation controller between first view , second view. correct way of placing navigation controller place before first view.
Comments
Post a Comment