New SwiftUI package drop!
PageView is a flexible container for creating paged interfaces.
- Pages can be decided 'in flight’, ideal for large datasets
- Works across iOS and macOS
- Handles complicated view hierarchies more consistently
- Allows for totally custom styles and interactions
Also included is PageIndicator with support for the new iOS 17 progress timer.
Certain styles such as .scroll and .historyStack bridge directly to UIPageViewController and NSViewController respectively, so you get all those great native behaviours.
But you can also adopt PageViewStyle to create completely custom transitions, like the 3D deck of cards in Messages.
Checkout the docs to see how:
Had a few people ask how you might go from a scrolling grid to a PageView, à la Photos app.
Using matchedGeometry will get you most of the way there, then it’s just a few little extras to keep both views in sync.
I’ve added some new sample code in the project to show how:
@phill I just saw your app appear in my home feed and I thought it was Yandex Mail. 🙊
The logos aren’t too similar, but maybe the colour scheme is. 🎨
@BenRiceM all the styles are lazy loaded, so go for it!
(⚠️ NOT SO BIG LTD cannot be held liable for thumb injuries sustained from all that swiping)
@BenRiceM that said, if you do have a very big data set it’s best to use the next/previous initialiser instead of the ForEach.
In Big Mail I’ve mapped the next/prev closure to a DB call that returns the next message ID.
The home of The Not So Big Company on Mastodon.