Closed gangelo closed 7 years ago
Of course it is possible. No delegate needed to do that, simply call the method refresh from left view controller. Do you use Swift or ObjC?
Swift 3
Assuming your main view controller is embedded in a navigation controller:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
//...
//...
let nc = self.revealViewController()?.mainViewController as? UINavigationController
let controller = nc?.topViewController as? YourMainViewController
controller?.refresh()
self.revealViewController()?.hideLeftView(animated: true)
//...
}
I will give it a try tonight thank you very much. I’ll let you know how it goes.
Worked great ty!
I am trying to find a way to delegate to the left view controller (menu) from the main view controller. Basically, my left menu has a menu option called "Refresh" in which, when clicked, I was hoping to dismiss the menu and call a "refresh" member within the main view controller that refreshes the data in the table view controller on that screen. I am sure there are other ways to do this that don't have to involve all this, but it seems the right place to put the option for my app. Is this possible?