美文网首页
ios 页面跳转

ios 页面跳转

作者: ai___believe | 来源:发表于2017-11-15 11:37 被阅读17次

xib跳到Storyboard

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UIViewController *viewOfStoryboard = [storyboard instantiateInitialViewController];

viewOfStoryboard.view.backgroundColor = [UIColor whiteColor];
[self dismissViewControllerAnimated:YES completion:nil];
[self presentViewController:viewOfStoryboard animated:YES completion:nil];

xib跳到ViewController

if (self.settingVC == nil) {

    self.settingVC = [[SettingViewController alloc] init];
    self.settingVC.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
    
}

[self.view addSubview:self.settingVC.view];

通过storyboard跳转到相对应的viewcontroller

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"dail" bundle:nil];
VoiceViewController *voiceViewController = [storyboard instantiateViewControllerWithIdentifier:@"VoiceViewControllerId"];

[self.navigationController pushViewController:voiceViewController animated:YES]

相关文章

网友评论

      本文标题:ios 页面跳转

      本文链接:https://www.haomeiwen.com/subject/jjycvxtx.html