我正在创建一个 ios 应用程序,但问题是我不知道如何在没有登录屏幕的情况下成功登录后添加 sidemenu 我实现并成功工作,但是如何在登录屏幕后使用我无法理解,因为这是我的第一个应用程序我正在创建让我展示我的 sidemenu 代码
我正在将 KYDrawerController 用于 sidemenu
在 App Delegate 我是这样完成的
var drawer = KYDrawerController.init(drawerDirection: .left, drawerWidth: 260)
let storyBoard = UIStoryboard.init(name: "Main", bundle: Bundle.main)
let mainVC = storyBoard.instantiateViewController(withIdentifier: "Screen2")
let menuVC = storyBoard.instantiateViewController(withIdentifier: "Drawer")
self.drawer.mainViewController = mainVC
self.drawer.drawerViewController = menuVC
self.window?.rootViewController = self.drawer
self.window?.makeKeyAndVisible()
在 ViewController On Button Action 中,我像这样使用 appdelegate 中的那个
let appDel = UIApplication.shared.delegate as! AppDelegate
appDel.drawer.setDrawerState(.opened, animated: true)
现在请告诉我点击登录按钮并登录成功后如何使用
在这里我直接设置mainVC但是登录时我不能设置因为我想在登录后显示sidemenu
我希望你理解我的问题请帮助莫如何做到这一点
供参考,我已使用此示例完成