Ready to use Swift to make a project, use this style. Sleep well at night. Dark Circles (--)
See details please visit my Githubhttps://github.com/zhangjingwang1993/swiftapp
You can also order a star and give an encouragement.
SWIFT/OC Advanced AC Group: 498143780
// AppDelegate.swiftvar drawer = MMDrawerController()
Let Leftviewcontroller = Leftviewcontroller () Let Rightviewcontroller = Rightviewcontroller () let Centerview Controller = Viewcontroller () Let Centernav = Uinavigationcontroller. Init(Rootviewcontroller:centerviewcontroller)//Set left and right controller drawer = Mmdrawercontroller. Init(Centerviewcontroller:centernav, Leftdrawerviewcontroller:leftviewcontroller, Rightdrawerviewcontroller: Rightviewcontroller)//SIDE Pull distance drawer. Maximumleftdrawerwidth=0.7* Width Drawer. Maximumrightdrawerwidth=0.7* Width//gesture drawer. Opendrawergesturemodemask= Mmopendrawergesturemode. AllDrawer. Closedrawergesturemodemask= Mmclosedrawergesturemode. AllSet animation here is set to open sidebar transparency from0To1Drawer. Setdrawervisualstateblock{(Drawercontroller, drawerside, percentvisible), Voidinchvar sidedrawerviewcontroller:uiviewcontroller? if (drawerside = = Mmdrawerside. Left) {Sidedrawerviewcontroller = Drawercontroller. Leftdrawerviewcontroller;} if (drawerside = = Mmdrawerside. Left) {Sidedrawerviewcontroller = Drawercontroller. Rightdrawerviewcontroller;} Sidedrawerviewcontroller?. View. Alpha= percentvisible} self. Window?. Rootviewcontroller= Drawer
In the left-hand VC TableView in the click Method
Func TableView (Tableview:uitableview, Didselectrowatindexpath Indexpath:nsindexpath) {Switch(Indexpath.row) { Case 0: LetCenterviewcontroller = Viewcontroller () LetCenternavigationcontroller = Uinavigationcontroller (Rootviewcontroller:centerviewcontroller) LetAppdelegate = Uiapplication.sharedapplication ().Delegate as! Appdelegate AppDelegate.drawer.centerViewController = Centernavigationcontroller appdelegate.drawer. Toggledrawerside (Mmdrawerside.left, animated:true, Completion:nil)default: LetOtherviewcontroller = Testviewcontroller () LetOthernavigationcontroller = Uinavigationcontroller (Rootviewcontroller:otherviewcontroller) LetAppdelegate = Uiapplication.sharedapplication ().Delegate as! Appdelegate AppDelegate.drawer.centerViewController = Othernavigationcontroller appdelegate.drawer.t Oggledrawerside (Mmdrawerside.left, animated:true, Completion:nil)}}
Use drawer effect in Swift project based on Mmdrawercontroller