performSegueWithIdentifier in swift [closed]
-
21-12-2019 - |
Question
If I have this Objective C code:
[self performSegueWithIdentifier:@"push" sender:self];
and
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if([segue.identifier isEqualToString:@"push"]) {
}
What is the Swift equivalent?
Solution
self.performSegueWithIdentifier("push", sender: self)
override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) {
if segue.identifier == "push" {
}
You have a typo in your self.preformSegueWithIdentifier
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow