Xcode Storyboard and xib connection

15,037

You can create XIB when you create connector.h and connector.m by selecting it subclass of UIViewController and click on the checkbox for: "With XIB for User Interface". If you have created already .m & .h files then you can just add a new GUI file by selecting View from the window & finally setting its Controller Custom class to connector You could have StoryBoard and XIB together in the same project. See for more help.

For presenting the view Controller you could use the following code

YourViewController *viewController=[[YourViewController alloc]initWithNibName:@"ViewControllerName" bundle:nil];

[self presentViewController:viewController animated:YES completion:nil];

In case of NavigatinController

   [self.navigationController pushViewController:viewController animated:YES];
Share:
15,037
Naveen
Author by

Naveen

Updated on June 29, 2022

Comments

  • Naveen
    Naveen almost 2 years

    I have one story board project with many view controllers and i created one class named "connecter.h,connector.m " now can i connect this class to one .xib file ?

    Please help me.