我正在使用Xcode 11.1,我的部署目标是iOS 10.0
我无法像以前那样实例化视图控制器。下面是代码:
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]?) -> Bool
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let viewController = storyboard.instantiateViewController(identifier: "TabBarController")
我遇到了以下错误:
'instantiateViewController(identifier:creator:)' 仅在 iOS 13.0 或更新版本可用
在 Xcode 11.1 上如何通过编程方式从 storyboard 实例化视图控制器?还有其他方法吗?
identifier:
更改为 iOS 版本 13 以下的withIdentifier
来解决了这个问题。 - Suh Fangmbeng