0

I'm building an universal app. I have already created two view controllers.in first view controller there is a search from and when user entered the data and hit the search button in the second view controller it shows the results.now what I want is to create a split view using these two views.

  1. Is it possibel? if it is posstible how can I do that and can we implement it only for portrait mode.(without landscape mode).
  2. Do we have to use a tableview as master view each and every time when we create a split view ?

hope your help with this.thank you very much.

caldera.sac
  • 4,918
  • 7
  • 37
  • 69

1 Answers1

1

UISplitViewController does pretty much everything you ask. If there is enough space it will display your view controllers side-by-side (see the preferredDisplayMode property). If you really want to force a side-by-side view controller arrangement in a confined space (ie. portrait), which is probably not advisable from a UX perspective, then you will need to write your own custom split view controller. Just layout 2 view controllers inside a parent view controller side-by-side and give each of them equal widths.

Also, you do not have to use a UITableView for your master view in a UISplitViewController. Each view controller in completely customizable.

Peter Cetinski
  • 2,328
  • 14
  • 8
  • are there any tutorials about implement this. – caldera.sac Jun 14 '16 at 03:47
  • @AnuradhS Apple's WWDC talks & docs are a great place to start, thanks to able code in slides and full sample projects. These searches should be plenty to get you started: http://asciiwwdc.com/search?q=UISplitViewController https://developer.apple.com/search/?q=UISplitViewController – Slipp D. Thompson Jun 17 '16 at 23:29