9

Im developing one Universal app (for iPhone and iPad both). Following is the requirement of app .

Requirement

1.There should be a menu (master on the left) and detail (on the right).

2.For iPhone menu or masterViewController should be on drawer or on slide out menu. Drawer or slid out menu

3.For iPad menu should be on rootViewController of splitView. menu in master of splitViewController

i have already tried

I tried to implement it using spiltViewController, for iPad it is working fine (MasterViewController is coming on left of the screen and DetailViewController is on right side of the screen ) but for iPhone it is simply working as UINavigationController (MasterViewController controller as rootViewController of UINavigationController).

what approach should i use to implement it?

Wali Haider
  • 1,202
  • 1
  • 16
  • 23
  • That's normal as the iPhone is a much smaller screen space. If you want to do this you should consider creating a custom slide out navigation. Ray Wenderlich has a few tutorials, this is the latest http://www.raywenderlich.com/78568/create-slide-out-navigation-panel-swift – App Dev Guy May 05 '15 at 04:09
  • @SASmith that i know but the problem is on iPad masterViewController should be placed on left side of the the screen like splitView not on slide out navigation or drawer.for iPhone it is fine . – Wali Haider May 05 '15 at 04:30
  • Your question is not really clear about that my friend. You should consider putting that in there. Are you referring to when it is in Portrait mode? Add a little more detail to your question about this and I will try to help. – App Dev Guy May 05 '15 at 04:33
  • And it's not currently displaying with both the master and detail on iPad in Landscape? – App Dev Guy May 05 '15 at 04:56
  • For iPad it is working fine because i have implemented it using UISplitViewController but for iPhone i want this masterViewController to be placed in slide out menu and i don't want to create two different controller one for iPhone and one for iPad. – Wali Haider May 05 '15 at 05:01
  • So you're asking - **How do I have the same menu on both iPhone and iPads using UISplitView on iPad and a drawer on iPhone?** Your question does not really define what you want. Also, is your menu static or will it be altered based on user input? If it is static then you set the menu content manually in storyboard, so there is no additional work coding. You just drag and drop labels in the cells. If it is dynamic, make a custom cell and reference it both the iPhone class and the iPad class. – App Dev Guy May 05 '15 at 05:11
  • Yes correct,I want to have same menu on both,Using UISplitView on iPad and using drawer on iPhone – Wali Haider May 05 '15 at 06:49
  • @walinaqvi did you get this type of drawer? then please share with me. – mohitdream4u Jun 26 '15 at 11:57

1 Answers1

1

Since iOS8 you can use UISplitViewController for this purpose.

The solution starts at 14:00 aprox in this WWDC 2014 video: View Controller Advancements in iOS8

More info at: http://coding.tabasoft.it/ios/the-new-uisplitviewcontroller/

crubio
  • 6,394
  • 4
  • 30
  • 33