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:

interface builder

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

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -