我正在尝试实施此控件:Side Menu 它说我需要在故事板中实现它:
let menuLeftNavigation = Controllerstoryboard!.instantiateViewController(withIdentifier: "LeftMenuNavigationController") as! UISideMenuNavigationController
但是我没有故事板,我已经创建了一个UINavigationController(见下文)所以我可以使用该模块:
SideMenuManager.menuLeftNavigationController = menuLeftNavigationController
AppDelegate.swift
didFinishLaunchingWithOptions {
let layout = UICollectionViewFlowLayout()
let featuredVideosController = FeaturedVideosController(collectionViewLayout: layout)
window?.rootViewController = UINavigationController(rootViewController:featuredVideosController) //Required
}
我现在被困在这里。谢谢你的帮助:)
答案 0 :(得分:2)
在FeaturedVideosController
' viewDidLoad
方法中,添加:
let menuLeftNavigationController = UISideMenuNavigationController(rootViewController: YourMenuContentViewController)
menuLeftNavigationController.leftSide = true
SideMenuManager.menuLeftNavigationController = menuLeftNavigationController
查看Side Menu 代码实施部分中的详细信息。