nmy
nmy

Reputation: 498

Present a UIViewController with active background

There is a view controller (B), which presents as a half-screen modal with a custom presentation style and animation. I present this on a button tap on the main view controller (A), and dismiss with a close button on modal. When this modal is presented I want to access background view (A) buttons too. But when I inspect there is a TransitionView between the modal (B) and the background view (A).

Is there anyway to achieve this by presenting B as a modal on top of A? Or is there any other approach to show both A and B together & keep both active?

enter image description here

Upvotes: 0

Views: 574

Answers (1)

pronebird
pronebird

Reputation: 12230

Yes it's possible, for modal presentation you have to use UIPresentationController and set shouldRemovePresentersView = false and implement UIViewControllerAnimatedTransitioning to perform the actual animation.

Alternatively you can use UISplitViewController with overlay presentation style, which then will take care of animations and layout for you.

Upvotes: 1

Related Questions