簡體   English   中英

如何迅速應用禮物

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM