Search code examples
iosipaduisplitviewcontrolleripados

Overlay 'master' view for splitviewcontroller on ipadOS


I want to reproduce the 'master' view from the 'Find my' app in ipadOS. It looks like a splitviewcontroller but the 'master' view is like an overlay and this is very convenient if you have a map behind. I can't find the docs surrounding this. Any idea how to do this?

example of Find my app on ipadOS


Solution

  • As far as I know, there is no built-in system API to achieve this floating overlay effect, but people have tried to recreate it and made their efforts open-source.

    This is not as easy as using a UISplitViewController, you will instead need to define your own presentation viewcontroller and presentation animations.

    This makes things a lot more difficult, as you will also have to think about

    • Device orientation changes
    • Behavior on iPadOS vs iOS
    • Having multiple instances of your app open at once (on iPadOS)
    • How should tableviews behave on scrolling?

    I am aware of the following open-source projects on GitHub that partially solve your problem. Let me give you a quick overview:

    • Pulley: Replicates the visual effect for iPad that you aim for, but iirc lacks some intuitive behavior when it come to scrollviews or tableviews.
    • OverlayContainer: Only creates the iOS version of the "overlay effect" but does that extraordinarily well while also giving you more fine-grained control.
    • FloatingPanel, which I do not have any experience with