Creating a segue programmatically

前端 未结 13 1154
名媛妹妹
名媛妹妹 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:27

    Guess this is answered and accepted, but I just would like to add a few more details to it.

    What I did to solve a problem where I would present a login-view as first screen and then wanted to segue to the application if login were correct. I created the segue from the login-view controller to the root view controller and gave it an identifier like "myidentifier".

    Then after checking all login code if the login were correct I'd call

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

    My biggest misunderstanding were that I tried to put the segue on a button and kind of interrupt the segue once it were found.

提交回复
热议问题