swift3纯代码任意位置跳转到任何页面,特别适合AppDelegate中

来源:互联网 发布:微信加友软件免费版 编辑:程序博客网 时间:2024/05/22 10:57

swift3纯代码任意位置跳转到任何页面,特别适合AppDelegate中跳转页面

//跳转到对话页面        let sb = UIStoryboard(name: "Main", bundle:nil)//拿到SB        //实例化,注意要设置视图的标识        let vc = sb.instantiateViewController(withIdentifier: "kefu") as! KefuViewController        //跳转        self.window?.rootViewController!.present(vc, animated:true, completion:nil)
0 0
原创粉丝点击