Follow

A new interaction in Big Mail is swiping between messages. The message background extends into the UI chrome, and when combined with the device-matched corner radius, creates the illusion of pushing the whole display – satisfying!

🧵 Here's how it's built, along with some code

If you're familiar with SwiftUI, you might think it’s a TabView with a page style, but it's not.

TabView needs to know all your views upfront, which if you have lots of messages, is very expensive.

In this example, TabView reevaluates all 1,000 items on each and every swipe 🥴

Instead, our new PageView container requests views one by one, only as they're needed.

Sometimes an imperative API is what you want 😅

PageView then has platform specific implementations using UIPageViewController and NSPageController, respectively.

You can take a look at the full code here: gist.github.com/phillipcaudell

The final part of the effect is to get the toolbar and page to move together as one. SwiftUI toolbars are anchored to their parent NavigationStack, so are unaffected by any page movements.

The trick here was to implement my own replica toolbar, and embed it in the safe area of the page.

@phill How did you manage to get the devices corner radius? Did you have to manually determine it with each device and build a manual check, or did something like ContainerRelativeShape work out?

@anthony there is a private property on UIScreen called _displayCornerRadius which you should definitely not use.

@phill maybe for all the font newsletters I get.

@phill `safeAreaInset(…)` is such a neat modifier. Cool effect!

@phill I’m so disappointed with the built in TabView + Paged style :/

@phill We resorted to a very similar `UIPageViewController` wrapper for infinite agenda paging in Daybridge 😅

@phill Views are just values on the stack, basically negligible to init and their body is only called if on screen.

@phill is there app for iPhone 📱 or only for Mac 💻

@phill that’s lovely… am I actually going to enjoy reading email? That’s innovation!

@phill looks interesting Not available in Belgium App Store though.

@plaeremans not available anywhere just yet — launching later this year.

@phill I hope all these learnings will apply to Big News eventually 😁

@phill Will you support office 365? Love the UI. I’m fed up with all the same traditional UI in mail..looking forward for this.

@phill is there a TestFlight? I’m interested in giving Big Mail a shot again. BTW, I seriously respect how you took the feedback on version 1.

@blake Thanks Blake! And no public TestFlight yet, but keep an eye out here :-)

@phill Why is it not available in Germany?

I like to give mail-apps a try.

@rinnerer not publicly available — will be launching later this year :-)

Sign in to participate in the conversation
The Not So Big Company

The home of The Not So Big Company on Mastodon.