[英]How do I apply present working properly in swift
我的應用程序使用swift 4遇到麻煩。我想在我的字符串獲得不帶nil的值時自動移動視圖控制器。 (建議性)
但是,它根本不起作用。
if(rst_str != nil){
let nextView = storyboard?.instantiateViewController(withIdentifier: "viewListController") as! ViewListController
//viewListController.delegate = self;
print("log storyboard");
self.present(nextView, animated: true, completion: nil);
}
正常打印“日志情節提要”的消息。 但是,self.present線根本不起作用。
我該如何解決我的問題?
線
self.present(nextView, animated: true, completion: nil);
在2種情況下無效
1-當前在此行中運行的vc當前尚未完全布局-例如在viewDidLoad
創建它
2-當前的vc當前正在呈現另一個vc
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.