Мой Действие:
let notificationName = Notification.Name("bscNotification")
NotificationCenter.default.post(name: notificationName, object: nil, userInfo:["id":indicator!])
в HomeViewController (PageViewController):
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. Это одно из решений. Могло быть еще много. – Adeel
Я добавляю уведомление в домашний ViewController? – breno
Эмм! Трудно сказать так. Вероятно, вы должны добавить скриншот структуры ваших экранов и кода. Тогда я смогу предложить, куда поместить. – Adeel