![](/img/trans.png)
[英]Is it possible to implement a Split View Controller within a Navigation Controller in an iOS app?
[英]Is it possible to pop view controller from navigation controller in iOS while the app is in background?
當應用程序在后台時,是否可以從 iOS 中的導航 controller 中彈出視圖 controller? 我寫了一個后台任務。 當我將應用程序切換到后台時,仍然可以執行一些代碼,但vc.navigationController?.popToRootViewController(animated:false)
沒有任何效果。 我確定它已經被執行了。
我認為 UI 轉換僅在主線程中工作。 因此,您對 root 的彈出是在后台線程中。 這可能會導致您的應用程序崩潰一段時間。 我認為當您即將讓您的應用 go 進入后台時,唯一的解決方案是 popToRoot。 處理來自 Appdelegate 的委托來執行此操作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.