
There are at present 3 methods to current popovers. One is with UIPopoverPresentationController
, however that solely works on iPad. You can additionally current a UIMenu
, however that’s just for iOS 14+. Lastly, you may use UIAlertController
. That is in all probability the best to implement — but additionally probably the most limiting, because it helps solely labels, buttons, and textual content fields.
So… what if you happen to want an in-app notification? An image-in-picture video? Or an onboarding popup? That is the place customized popovers are available in.
We’ll be utilizing the Popovers library. Full disclosure: I’m the developer of this. Nevertheless it’s 100% open supply and beneath the MIT license, so be happy to make use of it nevertheless you need.
First, you’ll want so as to add the library to your undertaking. Popovers helps Swift Bundle Supervisor — in Xcode, simply go to File
→ Add Packages…
, then enter the URL:
https://github.com/aheze/Popovers
With that, let’s get began!