Я пытаюсь получить доступ к объектам из дочернего контроллера, но он всегда возвращает ноль. Пожалуйста, проверьте код ниже.
let mainStoryboard = UIStoryboard(name: "Main", bundle: Bundle.main)
let vc: UITabBarController = mainStoryboard.instantiateViewController(withIdentifier: "TabBarController") as! UITabBarController
vc.selectedIndex = 2
let vc1 = vc.viewControllers?[2] as? FormViewController //this line returns nil
vc1?.fillUserData(dataDic: convertJsonStringToDictionary(jsonString: decodedURL))
vc1?.formViewDelegate = self
self.present(vc, animated: true, completion: nil)
Пожалуйста, пролите немного света.