Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • HOW TO MOVE FROM ONE CONTROLLER TO ANOTHER WITHOUT SEGUE?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 450
    Comment on it

    Hello all !!
    Explanation of the topic is :--

    Whenever we have to move from one controller to another we usually do it by performing Segue between the two view controllers in the MainStoryboard..
    The segue requires an identifier and from where we have to move to next controller we implement the code for it.. This is one way.

    Alternatively, for doing so we can provide Storyboard ID and then just perform the following code to move from one controller to any other controller.
    This method prevents from remembering the segues between the several view controllers and we can directly use the identifier of the controller in which we want to push/pop the view..
    Here's the code !!

     
    DestinationViewController  *comments =  [self.storyboard instantiateViewControllerWithIdentifier:@"commentsControllerIdentifier"]; // DestinationViewController is the next controller where we want to go.
    
    [self.navigationController pushViewController:comments animated:YES];

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: