I am Swift beginner.
Don’t know how to send data from UITabBarController to NavigationController→UITableViewController
I confirmed data sent from UITabBarController to UIViewController with code 1 below.
(Code 1)
if let chartVC = self.viewControllers?[1] as? ChartViewController{
chartVC.stepTarget.text = "Target : " + data
}
Can anyone suggest how to write the code in case NavigationController is in place?
In another way, I confirmed data sent to newsVC instance with code 2 below.
But after I go to NewsViewController tab, data was reset.
Don’t know why.
(Code 2)
if let newsVC = self.storyboard?.instantiateViewController(identifier: “newsVC”) as? NewsViewController {
newsVC.rssArray = data
print(newsVC.rssArray)
self.navigationController?.pushViewController(newsVC, animated: true)
}
Can anyone suggest how to fix ?
Thank you very much !
BR
Tada Terao