リモート通知を処理しようとしています。 AppDelegateで私didReceive方法で は、私は、ビューを開くしようとしている:上部ナビゲーションバーが無効です
var storyboard = UIStoryboard(name: "Main", bundle: nil)
var destinationController = storyboard.instantiateViewController(withIdentifier: "InfoTraficViewController") as? InfoTraficViewController
destinationController?.infoTraficId = trafficInfoId
window?.rootViewController?.present(destinationController!, animated: true, completion: nil)
これは働いているが、トップナビゲーションバーは表示されません。だから、ユーザーは前に行くことはできません。
どうすればよいですか?私が試した:
self.navigationController?.setNavigationBarHidden(false, animated: animated)
しかし、それは働いていない
EDIT:それはで働いて
:Rajatに
var storyboard = UIStoryboard(name: "Main", bundle: nil)
var destinationController = storyboard.instantiateViewController(withIdentifier: "InfoTraficViewController") as? InfoTraficViewController
destinationController?.infoTraficId = trafficInfoId
var customUiNavController = storyboard.instantiateViewController(withIdentifier: "CustomUINavigationController") as? CustomUINavigationController
customUiNavController?.pushViewController(destinationController!, animated: true)
window?.rootViewController = customUiNavController
おかげ
'windows's rootViewControllerは' navController'にする必要がありますか? – aircraft