79409

Question:
I am trying to do view change with segue which activated by login button. But I cannot find performSeguewithIdentifier function in Xcode 6.1. What is the proper way to do that ?
Here is my scenario
User enters mail and password then clicks login button (1) Application checks user information if it is correct, then next view will be activated (2)
I already did application server connection and information checking so I need a way of opening new view after checking information.
Answer1:Here is Example:
self.performSegueWithIdentifier("push", sender: self)
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
if segue.identifier == "push" {
}
May be this can help you.
Answer2:You first create IBAction for the button and connect the action to Login button.
after that,
<ol><li>Remove the current segue from UIButton </li> <li>ctrl+drag from the source UIViewController to destination UIViewController. (not from login button)</li> <li>select "push".</li> <li>Give an identifier to the segue.</li> </ol>And add the below line after validating the fields,
[self performSegueWithIdentifier: @"segue_id" sender:self];