Moving to another view controller in iOS on Button Click

后端 未结 2 2234
小蘑菇
小蘑菇 2021-02-19 23:15

I am very new to iOS and I am still trying to grasp things. I am trying out this simple program in XCode 5 where when a user clicks the button, he will be redirected into anothe

2条回答
  •  [愿得一人]
    2021-02-19 23:48

    You know, using a storyboard you can also define a segue that isn't connected directly to a button, name that segue, and then call it programatically like so:

     [self performSegueWithIdentifier:@"showWebServiceViewController" sender:nil];
    

    I think this approach is cleaner and more in line with the storyboard way of working.

    Of course, depending on which user has logged in you could perform different named segues to get to the approporiate screen.

提交回复
热议问题