swift新手,今天在写项目的时候,需要加载一个页面,xib我用过了,就想试试storyboard,看看和oc有没有变化(没有变化)
主要的还是一样,需要给storyboard一个ID,因为代码层需要通过这个ID 去加载指定的storyboard
![](https://img.haomeiwen.com/i11730381/eb8e8f02ee084d05.png)
代码加载就是swift写法
let orderTVC = UIStoryboard.init(name: "这里是storeboard的文件名", bundle: nil).instantiateViewController(withIdentifier: "orderID") as! PUOrderDetailTVC
self.navigationController?.pushViewController(orderTVC, animated: true)
记录一下
网友评论