I am using view controller containment to manage a set of child view controllers which should be able to modally present other view controllers in a custom manner.
In your UIPresentationController
subclass, override shouldPresentInFullscreen
as follows:
override var shouldPresentInFullscreen: Bool {
get {
return false
}
}
As per the UIPresentationController
header:
// By default each new presentation is full screen.
// This behavior can be overriden with the following method to force a current context presentation.
// (Default: YES)
@property(nonatomic, readonly) BOOL shouldPresentInFullscreen;
This along with definesPresentationContext
should do the trick.