-1

I know this is a very stupid question.But I'm new to ios develop.And I even don't know the basic knowledge.

In Xcode 7.1,When I create an new project,storyBoard is default.I want to develop an app with multiple screens using xib files.Please tell how to do this?

  1. how to set the launch screen ?
  2. how to connect different xib files?

Anyway,could you tell how to build a simple project using xib step by step.Thank you very much.

lily
  • 23
  • 7
  • 4
    Your english is probably what's preventing you from finding this stuff yourself. I googled "xib tutorial" and got [this](http://www.appcoda.com/hello-world-app-using-xcode-5-xib/), and I googled "xib launch screen" and got [this](http://stackoverflow.com/questions/27998284/launch-image-or-launch-xib-storyboard). Google "view controller transitions" for your question about connecting different xib files. – Millie Smith Nov 20 '15 at 06:17

1 Answers1

0

If you want to have multiple XIB,follow the below steps

     First remove the storyboard file from your project
     In Deployment Info of TARGETS,delete Main from Main Interface
     The create the View(XIB). Give the name as ViewController.Xib

Then in appDelegate.h

    import - #import "ViewController.h"
    @property (strong, nonatomic) ViewController *vc;

Then in appDelegate.m

    @synthesize vc;

Then in didFininshLaunchingWithOptions

    - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
   {
      // Override point for customization after application launch.

      self.window = [[UIWindow alloc]initWithFrame:[[UIScreen mainScreen]bounds]];
      vc = [[ViewController alloc]initWithNibName:@"ViewController" bundle:nil];
      UINavigationController *navigationVC  = [[UINavigationController alloc]initWithRootViewController:vc];
      self.window.rootViewController = navigationVC;
      self.window.backgroundColor = [UIColor clearColor];
      [self.window makeKeyAndVisible];
      return YES;
   }

Next if want to crate multiple xib,you can create it with .h,.m and xib according to your requirements.

user3182143
  • 9,459
  • 3
  • 32
  • 39