使用未声明的类型 "ViewController"
Use of undeclared type "ViewController"
我正在使用 Tap Bar 控制器的库,因此我必须将 class 控制器的名称更改为 RAMAnimatedTabBarController
才能使用这些功能。但是在应用程序委托中,当我想显示主栏时,它会显示此错误
Use of undeclared type "RAMAnimatedTabBarController"
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if UserDataSingleton.sharedDataContainer.logged == "logged" {
let mainStoryboardIpad : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let initialViewControlleripad : UIViewController = mainStoryboardIpad.instantiateViewController(withIdentifier: "Order") as! RAMAnimatedTabBarController // error here
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = initialViewControlleripad
self.window?.makeKeyAndVisible()
}else{
let mainStoryboardIpad : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let initialViewControlleripad : UIViewController = mainStoryboardIpad.instantiateViewController(withIdentifier: "loginViewController") as! loginViewController
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = initialViewControlleripad
self.window?.makeKeyAndVisible()
}
您需要先导入它。在文件的开头,使用:
导入 RAMAnimatedTabBarController
我正在使用 Tap Bar 控制器的库,因此我必须将 class 控制器的名称更改为 RAMAnimatedTabBarController
才能使用这些功能。但是在应用程序委托中,当我想显示主栏时,它会显示此错误
Use of undeclared type "RAMAnimatedTabBarController"
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
if UserDataSingleton.sharedDataContainer.logged == "logged" {
let mainStoryboardIpad : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let initialViewControlleripad : UIViewController = mainStoryboardIpad.instantiateViewController(withIdentifier: "Order") as! RAMAnimatedTabBarController // error here
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = initialViewControlleripad
self.window?.makeKeyAndVisible()
}else{
let mainStoryboardIpad : UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
let initialViewControlleripad : UIViewController = mainStoryboardIpad.instantiateViewController(withIdentifier: "loginViewController") as! loginViewController
self.window = UIWindow(frame: UIScreen.main.bounds)
self.window?.rootViewController = initialViewControlleripad
self.window?.makeKeyAndVisible()
}
您需要先导入它。在文件的开头,使用: 导入 RAMAnimatedTabBarController