iOS xib 与StoryBoard 之间的互相,以及StoryBoard与StoryBoard之间跳转

xib 跳转到StoryBoard

    UIStoryboard *board = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
    //这是为了确定你用的那个StoryBoard
    UIViewController *vc = [board instantiateViewControllerWithIdentifier:@"02"];
    //这个02是自己预先在xib绑定的一个编号自己随意
    [self presentViewController:vc animated:nil completion:nil];

StoryBoard跳转到xib

    //别问我为什么用present,因为我试过用pop然而跳转不了 希望有大神解答

    UIViewController *registerController = [[UIViewController alloc] initWithNibName:@"SzRegisteViewController" bundle:[NSBundle mainBundle]];
    [self presentViewController:registerController animated:NO completion:nil];

StoryBoard与StoryBoard

    UIViewController *registController = [[self storyboard] instantiateViewControllerWithIdentifier:@"regist"];
    [self presentViewController:registController animated:NO completion:nil];

你可能感兴趣的:(oc-UI)