user2638084
user2638084

Reputation: 311

Xcode 6.1 button with segue

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.

Upvotes: 0

Views: 516

Answers (2)

Stive
Stive

Reputation: 6888

You first create IBAction for the button and connect the action to Login button.

after that,

  1. Remove the current segue from UIButton
  2. ctrl+drag from the source UIViewController to destination UIViewController. (not from login button)
  3. select "push".
  4. Give an identifier to the segue.

And add the below line after validating the fields,

[self performSegueWithIdentifier: @"segue_id" sender:self];

Upvotes: 0

Dharmesh Kheni
Dharmesh Kheni

Reputation: 71852

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.

Upvotes: 1

Related Questions