マイ処置:HomeViewController(PageViewController)で
let notificationName = Notification.Name("bscNotification")
NotificationCenter.default.post(name: notificationName, object: nil, userInfo:["id":indicator!])
:
let bscNotificationName = Notification.Name("bscNotification")
NotificationCenter.default.addObserver(self, selector: #selector(HomeViewController.showBSCInfo(notification:)), name: bscNotificationName, object: nil)
func showBSCInfo(notification:NSNotification){
let vc = UIStoryboard.init(name: "Main", bundle: Bundle.main).instantiateViewController(withIdentifier: "BSCInfoViewController") as! BSCInfoViewController
vc.IdIndicador = notification.userInfo!["id"]! as! String
vc.showBackButton = true
self.navigationController?.pushViewController(vc, animated: true)
}
あなたは、通知オブザーバとしてPageViewControllerを追加し、collectionViewのセルが選択されたときに通知を投稿することができます。これが解決策の1つです。もっと多くのことがあります。 – Adeel
ホームViewControllerに通知を追加しますか? – breno
Emm!このように言うのは難しいです。おそらくスクリーンの構造とコードのスクリーンショットを追加するべきです。それでは、どこに置くべきかを提案することができます。 – Adeel