segue transition with condition storyboard

前端 未结 1 867
天命终不由人
天命终不由人 2021-01-07 09:35

I am new to storyboard and xcode (using 4.4)

I would like to implement a login condition, that if accomplished - the segue would work. Otherwise, the user should sta

1条回答
  •  情话喂你
    2021-01-07 10:21

    Delete the blank line in between your if and [self perform...]

    Additionally, you may want to consider keeping your if-else statements in braces to keep this problem from happening again:

    if ([self.email isEqualToString:@"O"] && [self.password isEqualToString:@"O"]){
        [self performSegueWithIdentifier:@"LoginSegue" sender:sender];
    }else{
        [passwordText setText:@""];
    }
    

    If this doesn't solve the problem then be sure to varify that the segue is attached to the two controllers and not directly to a button.

    0 讨论(0)
提交回复
热议问题