ios - Xcode 使用 Drawercontroller 未声明的类型错误
解决方案
正如您可以在KYDrawerController 文档中查看您必须使用的那样,DrawerViewController
并且KYDrawerController
没有DrawerController
:
import UIKit
import KYDrawerController
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
let mainViewController = MainViewController()
let drawerViewController = DrawerViewController()
let drawerController = KYDrawerController()
drawerController.mainViewController = UINavigationController(
rootViewController: mainViewController
)
drawerController.drawerViewController = drawerViewController
/* Customize
drawerController.drawerDirection = .Right
drawerController.drawerWidth = 200
*/
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window?.rootViewController = drawerController
window?.makeKeyAndVisible()
return true
}
推荐阅读
- yii2 - 保存后如何获取模型主键值
- installation - 如何手动安装 dask[complete]?
- alexa - 用于游戏的 Alexa Web API - 技能清单
- angular - 使用 getDataAsExcel 将 Ag-Grid 表导出到 Excel 时无法将字符串列/数据解析为数值
- javascript - 将 javascript 字典读入 Python
- c# - 被认为是“some.dll”,但它不存在
- ios - Fastlane 没有这样的文件或目录存在的文件
- python - Django测试在响应状态码404上抛出错误
- swift - 使用 SwiftUI 时如何检查应用程序是否在 Apple Watch 上进入后台
- python - 删除数据框中字符后的所有内容