Life cycle Order
N (void) Loadview load memory
(void) Viewdidload loading complete
(void) Viewwillappear: (BOOL) animated page will be rendered to the screen
(void) Viewdidappear: (BOOL) animated page has been rendered
(void) Viewwilldisappear: (BOOL) animated page will disappear
6-(void) Viewdiddisappear: (BOOL) animated page has disappeared
7-(void) didreceivememorywarning memory tension
Delete Storyboard, Viewcontroller, delete the storyboard in info.
In Appdelegate:
Initialize window
Self.window = [[UIWindow alloc]init];
Initialize the left side bar controller
Sgleftmenuviewcontroller *LVC = [[Sgleftmenuviewcontroller alloc]initwithnibname:@ "SGLeftMenuViewController" bundle : nil];
Initializing the master view Controller
Mainviewcontroller *MVC = [[Mainviewcontroller alloc]initwithnibname:@ "Mainviewcontroller" bundle:nil];
Add navigation Bar
Uinavigationcontroller *NC = [[Uinavigationcontroller ALLOC]INITWITHROOTVIEWCONTROLLER:MVC];
Adding the sidebar manager will also set the side bar controller and the main view controller
Mmdrawercontroller *DC = [[Mmdrawercontroller alloc]initwithcenterviewcontroller:nc LEFTDRAWERVIEWCONTROLLER:LVC];
Enables the sidebar to hold the home page, and the sidebar manager
LVC.MAINNVC = NC;
LVC.MMD = DC;
//Set side bar Properties
Set left sidebar width
[DC setmaximumleftdrawerwidth:240.0];
Set Open left sidebar mode
[DC Setopendrawergesturemodemask:mmopendrawergesturemodepanningcenterview];
Set off left sidebar mode
[DC Setclosedrawergesturemodemask:mmclosedrawergesturemodepanningcenterview];
Popup animation speed
[DC setanimationvelocity:10000];
[DC Setshouldstretchdrawer:no];
Setting the window's root view Controller
Self.window.rootViewController = DC;
Lvc.view.backgroundColor = [Uicolor Bluecolor];
[Self.window makekeyandvisible];
Lan Yi Education life cycle Delete Storyboard