How to embed a split view controller?

I have following requirement:


The main screen is a map with search field.


Tapping on the map the app is showing a callout.


Tapping on callout I want to show split view controller

with more info about location.


Looking at Safari it is doing something similar.

When tapping on the bookmark icon a split view controller

appears where I can select favorites, etc. In landscape

the primary view controller is on the left side, tapping

on favorite link I can see the page at right.

The way how the split view controller appears it looks

like embedded in presented view controller.


From documentation I am learning that split view controller

must be always a root view controller.


Embedding split view controller in custom view controller,

I suppose I can show this custom view controller in presented view controller

and dismiss it when needed to show the map in the background if needed.


How to achieve the same functionality as in Safari?

Good, thanks for the update - where did the mapview end up?

It is architected like this:

=====================

root

|

Navigation Controller

|

View Controller

|

View

|

Map View

|

Search Bar at the top below Navigation bar

|

Toolbar at the bottom with 5 buttons

|

Tap on a button

|

=====================

Invokes MyContainerViewController like this:

let vc = self.storyboard?.instantiateViewControllerWithIdentifier("MyContainerViewController")

self.definesPresentationContext = true

self.modalTransitionStyle = .CoverVertical

vc!.modalPresentationStyle = .Popover /

vc!.modalTransitionStyle = .CoverVertical /

vc!.modalPresentationCapturesStatusBarAppearance = true

if let pres = vc!.presentationController {

pres.delegate = self /

}

self.presentViewController(vc!, animated: true, completion: nil)

=====================

MyContainerViewController

|

Split View Controller

|

Navigation Controller 1 Navigation Controller 2

Navigation Bar ->Done

| |

Master Detail

=====================


In fact there can me many Split View Controllers but each need to be embedded in
its own Container View Controller.

Done -> closes the presented View Controller with:

self.dismissViewControllerAnimated(true, completion: nil)


Everything is working fine after invoking SVC via presentViewController

How to embed a split view controller?
 
 
Q