我有一个标签栏控制器,在那个标签栏里面我有五个视图控制器。我也有一个在 homeVC 上的右视图控制器(抽屉)。对于 rightViewController 我使用 MMDrawerController 来源:https ://www.youtube.com/watch?time_continue=1468&v=TdKnImb4SWs 。在 appdelegate 中。现在当右视图控制器关闭时,视图控制器的哪个生命周期被调用?因为我想写一个函数。我在 appdelegate 上使用过这段代码
let rightViewController = mainStoryboard.instantiateViewController(withIdentifier: "RightViewVC") as! RightViewVC
UINavigationBar.appearance().titleTextAttributes = [NSAttributedStringKey.foregroundColor : UIColor.white]
let rightSideMenuNav = UINavigationController(rootViewController: rightViewController)
drawerController = MMDrawerController(center:mainPage,rightDrawerViewController:rightSideMenuNav)
// drawerController!.openDrawerGestureModeMask = MMOpenDrawerGestureMode.panningCenterView
drawerController!.closeDrawerGestureModeMask = MMCloseDrawerGestureMode.panningCenterView
drawerController!.closeDrawerGestureModeMask = MMCloseDrawerGestureMode.all
drawerController!.preferredInterfaceOrientationForPresentation = MMDrawerOpenCenterInteractionMode.full
window?.rootViewController = drawerController