I am using sidebar like FB.I need to use that sidebar for every view controller.But i need to write a code in single page alone and call that single view controller to every view controller without using any plugins or storyboard.Please find the images below.I have three view controller like view1,view2 and sidebar.I need to load the sidebar controller in both view1 and view2 with that corresponding button action.But my app get crash if i click the button inside the sidebar.If i wrote action that button in view1 and view2 means it is working.So i need to work with sidebar controller button action.
Asked
Active
Viewed 115 times
0
-
Please find the images below, but **Where are images???**. – Toseef Khilji Jan 28 '14 at 11:02
-
Can you please add some more information to your question, like the images you refer to, the code you use where the app crashes... – user1781290 Jan 28 '14 at 11:04
-
the code to load the sidebar view NavigationViewController *cont=[[NavigationViewController alloc]init]; [cont LoadData:backgroundView:self.view]; -(void) LoadData :(UIView *) view1 :(UIView *) view2 { UIButton *settings1=[UIButton buttonWithType:UIButtonTypeCustom]; [settings1 addTarget:nil action:@selector(ButtonAction2:) forControlEvents:UIControlEventTouchDown];[backView addSubview:settings1]; In this i cant get buttonaction2 – MaheThiru Jan 28 '14 at 11:32
-
sorry viruss i cant load my images..Please refer this link for imageshttp://stackoverflow.com/questions/21403357/using-multiple-view-controller-in-single-view-controller-iphone-sdk – MaheThiru Jan 28 '14 at 12:04
1 Answers
0
You can use MFSideMenu.
It utilizes view controller containment and gives you a simple API for implementing side-menu functionality. It integrates with storyboard-based apps as well as traditional setups.
If you want to write your own code then go through this Answer. It contains all the steps with description. You can follow them easily.
-
thanks bhavin.but i don't need to use plugin or anything.i need to write my own code with uiview and uiview animation. – MaheThiru Jan 28 '14 at 10:50
-
Thanks man that is too hard to understand for me.My problem i cant write action for button inside the sidebar using another view controller.so please tell me whether it is possible – MaheThiru Jan 28 '14 at 11:25
-
NavigationViewController *cont=[[NavigationViewController alloc]init]; [cont LoadData:backgroundView:self.view]; – MaheThiru Jan 28 '14 at 11:25
-
@user3243829 : Why you want to write your own code when you have already a list of sample codes available? – Bhavin Jan 28 '14 at 11:27
-
In my company they are expecting some animation effect also with that so if it is my own code i feel better that is why – MaheThiru Jan 28 '14 at 11:36
-
@user3243829: But when you have a sample code, you can always use the lines that you want to use and for other things, you can customize. So, just go through `MFSideMenu`, customize the animation effect and use it in your app. That's it !! For that there is no need to write all the things from the scratch. – Bhavin Jan 28 '14 at 11:37