ios - Custom Unwind Segue Crashes with NSException in Swift -
i have unwind segue have custom animation.
i have custom segue class:
import uikit import quartzcore class seguefromright: uistoryboardsegue { override func perform() { let src: uiviewcontroller = self.source let dst: uiviewcontroller = self.destination let transition: catransition = catransition() let timefunc : camediatimingfunction = camediatimingfunction(name: kcamediatimingfunctioneaseineaseout) transition.duration = 0.25 transition.timingfunction = timefunc transition.type = kcatransitionpush transition.subtype = kcatransitionfromright src.navigationcontroller!.view.layer.add(transition, forkey: kcatransition) src.navigationcontroller!.pushviewcontroller(dst, animated: false) } }
i have defined unwind segue:
@ibaction func unwindtogameover(sender: uistoryboardsegue) { }
i call segue on button press:
@ibaction func backbuttonpressed(_ sender: any) { performsegue(withidentifier: "unwindtogameover", sender: self) }
here's interface builder unwind segue:
it crashes "terminating uncaught exception of type nsexception"
the custom segue works on show segue & unwind segue works when remove class.
any ideas?
you're using unwind segue , custom segue pushing. unwind segue in navigation controller pop, not push.
frankly, nowadays you'd use custom transitions, rather subclassing segue, if change pop, works.
wiki
Comments
Post a Comment