interface builder - iOS Custom Segue Not Working -



interface builder - iOS Custom Segue Not Working -

i starting larn how develop ios apps. (note using xcode 6 beta , swift) think i'm building interfaces themselves, seem having problem segues.

the first page of app simple screen sign button , sign in button. made separate view controller sign page , set text field on it. both of these view controllers in storyboard. made custom segue class animate start page , sign page moving 1 screen left, sign page showing. custom segue class:

class slidefromrightsegue: uistoryboardsegue { override func perform() { allow screenwidth = uiscreen.mainscreen().bounds.width allow center = self.sourceviewcontroller.view!.center uiview.animatewithduration(0.25, animations: { self.sourceviewcontroller.view!.center = cgpoint(x: center.x - screenwidth, y: center.y) self.destinationviewcontroller.view!.center = cgpoint(x: center.x - screenwidth, y: center.y) }, completion: { (finished: bool) in self.sourceviewcontroller.presentviewcontroller(self.destinationviewcontroller uiviewcontroller, animated: false, completion: nil) }) } }

i based off tutorial found, , don't think there problem here. animate both source , destination vc's center 1 screen left. i'm not exclusively sure how animations work in ios tutorial found structured similarly, assume closure passed "animations" parameter called , ios generates of steps in between , draws each frame screen. (correct me if i'm wrong)

so have custom segue. go storyboard, click on sign button, go on connections tab, , drag "triggered segues - action" on sec vc, select "custom" , select custom class. reason, instead of beingness "slidefromrightsegue", it's "_ttc524slidefromrightsegue". i'm not sure why that's happening, assume has fact renamed segue class, , hope that's not causing problems. anyway, doing creates arrow first vc sec vc, assume worked.

when run app, start screen usual. click sign button, , nil happens. there missed, set breakpoint in perform() function of segue , in prepareforsegue() function of first vc. neither 1 triggered. think have segue set properly, have wrong actual implementation app. have thought what's going on?

so yea, turns out problem was using custom button class well, had overrides touchesbegan, touchesended, , touchescancelled functions. overrides did not callback superclass methods, action of pressing button wasn't beingness triggered.

i guess lesson can take create sure know function overrides must phone call superclass, , should override superclass. touch event handlers need phone call superclass.

ios interface-builder segue ios8 xcode-storyboard

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -