skip to Main Content

Xcode – passing viewController as a parameter in function

I want to pass viewController type as a function just like the code below extension UIViewController { func switchScreen(storyboardName:String,viewControllerName:String,vcc:UIViewController) { let mainStoryboard = UIStoryboard(name: storyboardName, bundle: Bundle.main) if let viewController = mainStoryboard.instantiateViewController(withIdentifier: viewControllerName) as? vcc { self.present(viewController, animated: true, completion:…

VIEW QUESTION
Back To Top
Search