I switch to ChildViewController with the goChildViewController function in Parent View.
class ParentViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
}
func goChildViewController() {
DispatchQueue.main.async {
self.navigationController?.view.layer.add(CATransition().popFromRight(), forKey: nil)
self.navigationController?.pushViewController(ChildViewController(), animated: false)
}
}
func needToAccessThisFunction() {
// I need to call this function from ChildViewController
}
}
I want to access the function "needToAccessThisFunction" from the ChildViewController.
class ChildViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//ParentViewController.needToAccessThisFunction()
}
}
How can I do that?