Search code examples
iosswiftuiviewcontrolleruikituistoryboardsegue

Transparention of UIController in Swift - what segue chose?


I am trying to chose right segue to have good "DropDown" in swift UIKit. Only progress I have made is this:

Present modally, full screen

or this:

Present as popover

My point is that i want the combination of these two. I don't want popover but also i wanna see the top part of the last controller. Is that even possible?


Solution

  • Unfortunately, Apple doesn't hand you one of these "half covering" presentations on a silver platter; you have to build it yourself. Use a presented view controller whose modal presentation style is custom and provide a transitioning delegate. Now you can make a custom transition animation with a custom UIPresentationController that puts you in charge of where the presented view controller's view will go. Adding the "shadow view" behind the presented view is up to you as well, so if you don't want it, don't add it.