首页 > 其他分享 >[ios]多个storyboard跳转

[ios]多个storyboard跳转

时间:2022-10-10 21:40:18浏览次数:43  
标签:storyboard UIStoryboard navigationController ios board 跳转 YES animated self


1、单个storyboard跳转


UIStoryboard *board = self.storyboard;
HomeController *homevc = [board instantiateViewControllerWithIdentifier:@"homevc"];
[self.navigationController pushViewController: homevc animated:YES];

2.多个:


UIStoryboard *board = [UIStoryboard storyboardWithName:@"Login" bundle:nil];
LoginController *loginvc = [board instantiateViewControllerWithIdentifier:@"loginvc"];
[self.navigationController pushViewController: loginvc animated:YES];

PS:在有多个storyboard的情况下,都要替换成这种声明方式

 

*不同跳转方式:

//Modal方式



[self presentModalViewController:my_device_vc animated:YES];
//使用了navitgation

[self.navigationController pushViewController: loginvc animated:YES];


//回退


[self.navigationController popViewController animated:YES];


 

swift:

let bookDateVC = UIStoryboard(name: "Book-date", bundle: nil).instantiateViewController(withIdentifier: "book-date")
bookDateVC.title = "预约日期及时间"
self.navigationController?.pushViewController(bookDateVC, animated: true)

 

 

标签:storyboard,UIStoryboard,navigationController,ios,board,跳转,YES,animated,self
From: https://blog.51cto.com/u_15740686/5745302

相关文章

  • [IOS]如何结合XCODE使用git以及异常处理
    1.控制台cd到项目目录下,输入命令:gitinit 2.在gitserver创建xxx/project_name.git,输入命令:git--bareinit 3.本地控制台:gitadd.gitcommit-m"firstCommit"git......
  • IOS Push notification 摘要
    2.​​registerForRemoteNotificationTypes: is not supported ​​​​in​​​ ​​iOS 8.0 and later.报错​​解决办法可参考:http://stackoverflow.com/questi......
  • Linux磁盘相关工具 -- iostat
    iostat主要用于监控系统设备的IO负载情况,根据这个可以看出当前系统的写入量和读取量,CPU负载和磁盘负载。iostat主要用于输出磁盘IO和CPU统计信息。1. iostat用法:iostat......
  • axios完整配置请求数据
    <scripttype="module">importaxiosfrom'./lib/axios.min.js'//axios完整配置请求语法:axios(config)axios({url:'/admin/detail',//url会拼接在......
  • Flutter(六):Flutter_Boost接入现有原生工程(iOS+Android)
    一、新建原生工程和FlutterModule1、新建Android工程搭建一个空的Android工程FlutterDemo_Android模拟已经存在的原有工程Android项目配置:2、新建iOS工程搭建一个空......
  • iostat命令
    一、概述iostat主要用于输出磁盘IO和CPU的统计信息iostat属于sysstat软件包,可以用yum installsysstat直接安装二、iostat用法1、用法:iostat[选项][<时间间隔>......
  • Axios 取消重复请求
    在实际开发中,我们需要对用户发起的重复请求进行拦截处理,比如用户快速点击提交按钮解决办法1、新建request.jsimportaxiosfrom'axios'//创建axios实例constse......
  • Vue3使用axios
    如何在Vue项目中使用axios请求http://www.45fan.com/article.php?aid=1D82KNnQB62JUc6OVue3-使用axios发起网络请求https://blog.csdn.net/liuyuxin36/article/details/......
  • axios取消上一个请求
      链接,里面有效果,亲测有效果https://codesandbox.io/s/simple-example-of-cancelling-axios-request-kyrnc?file=/src/App.vue:1074-1096这个可能需要外网才能打开,要......
  • 三、Axios入门——Axios的CRUD基本使用
    一、启动json-server服务详细教程:https://www.cnblogs.com/wml-it/p/16773220.html二、搭建页面<!doctypehtml><htmllang="en"><head><metacharset="UTF-8">......