Hi
I use the AZTabBarController to controller my tab bar. When I present a new view, It works well. I got an issue to bring the data back to the parent viewController. I use self.presentingViewController to get my parent view controller. but it crash at all. Below are my code in the childViewController.
@IBAction func storeBtn(_ sender: UIButton) {
let vc = self.presentingViewController as! MoreViewController
vc.phoneLabel.text = "1234"
self.dismiss(animated: true)
}
Error message:
2020-04-14 19:24:18.058780+0800 InsuranceMasterSales[26704:24913201] Could not cast value of type 'InsuranceMasterSales.SixItemTabbarViewController' (0x10e84d178) to 'InsuranceMasterSales.MoreViewController' (0x10e84bc30).
It seems that swift get confused about the presentingViewController. How to solve this question? Thank you.