iOS 9 Swift Segue from TextField -
i trying start uiactivityindicator user clicks "enter" on uitextfield. since once hit enter app fetches information stored in web, user know app working.
the web fetch happens inside shouldperformseguewithidentifier function, given based on results segue or not happen.
so, order of methods called starting when user clicks on return key. want start uiactivityindicator @ exact moment. tried "textfielddidendediting , textfieldshouldreturn" both of them happen after prepareforsegue , shouldperformseguewithidentifier.
thanks lot in advance.
why not call code in textfieldshouldreturn
itself?
func textfieldshouldreturn(textfield: uitextfield) -> bool { activityindicator.startanimating() //do web stuff if shouldperformsegue == true { self.performseguewithidentifier("some identifier", sender: self) } return true }
Comments
Post a Comment