Creating a segue programmatically

前端 未结 13 1095
名媛妹妹
名媛妹妹 2020-11-22 12:41

I have a common UIViewController that all my UIViewsControllers extend to reuse some common operations.

I want to set up a segue on this \"

13条回答
  •  谎友^
    谎友^ (楼主)
    2020-11-22 13:18

    For controllers that are in the storyboard.

    jhilgert00 is this what you were looking for?

    -(IBAction)nav_goHome:(id)sender {
    UIViewController *myController = [self.storyboard instantiateViewControllerWithIdentifier:@"HomeController"];
    [self.navigationController pushViewController: myController animated:YES];
    
    }
    

    OR...

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

提交回复
热议问题