A simplistic recreation of the MobileSafari tab bar on iPad
SafariTabBar
This is a simplistic recreation of the MobileSafari tab bar on iPad (prior to iPadOS 15). It is also very unfinished, and not intended in any way to be a usable control or library in your apps. I’m providing this as illustrative sample code just because it’s kinda neat.
This code also demonstrates how you could drag a tab out into a new window on iPad, using NSUserActivity.
Issues
- There is no logic to provide an overflow menu when there are too many tabs onscreen.
- The way the tab layout is implemented hinders the ability to animate tab transitions
- I would do the top toolbar a different way, if I were implementing this in a real app
- Newly spawned windows via drag & drop are generated with fresh tabs, not actually presenting the tab that was dragged