Show newer

Big Mail 2, nay, ALL my apps, wouldn't be possible if it weren't for the generous contributions of others in the OS community.

I can't wait to give back, so that's why I plan to open source all of Big Mail's core packages: SwiftIMAP, SwiftSMTP, and SwiftEmail.

They're all super Swifty, modern, and hopefully instantly familiar to anyone who's used Foundation.

Show thread

There's also a sister package, GRDBQuery, which gives you a @Query property wrapper for SwiftUI (similar to @FetchRequest in Core Data)

You're then able to write views that automatically update when anything in the database changes.

Here's all the code needed for the account picker in Big Mail. So clean.

github.com/groue/GRDBQuery

Show thread

Swipey swipe 🫵

Edit: this is swiping left on the message viewer, not tapping the List. Don't worry it's not a transition 😬

Here it is on iPhone: mastodon.notsobig.co/@phill/10

Okay, another update on my Navigation Saga, because sharing is caring.

After integrating, I noticed selected rows wouldn't unselect when popping back.

Turns out using .tags() will only work if:

1) The root List is bound directly to an ObservedObject. A Binding to the same value in an ObservableObject won't work.

2) The List must only contain Text or Label views (so no pinned Grid at the top).

I'm also not sure why the Binding gets fired so many times VS the ObservedObject either?

Show thread

Oh. Transitions break if you multitask out of the app and back.

…so instead, I'm switching to a Stack when compact. Only issue is getting NavigationLink, SplitView and Stack to play together.

In the end I found it was easier to remove NavigationLinks all together, and instead use tags. Lists then use this as their selection value.

Then, using those selections, I'm computing a path to drive the Stack. Once I caught EditMode, it all worked.

No jittery toolbars. Smooth transitions. Consistent and predictable across iPhone/iPad/Mac.

Thank god.

Show thread

Well hot damn, someone on Twitter suggested setting the Set's underlying type to Optional, and voila, editing and navigation!

I'm still not entirely sure why this works though. Surely an empty Set would denote no selection? Making the type itself Optional isn't intuitive at all.

Even the init signature doesn't give any hints, only that the Binding itself can be Optional... 🤷‍♂️

Show thread

I refuse to sleep until I have found a solution to this, which is unfortunate, as it means I may never sleep again 🥲

I've now officially arrived in crazy town, and started wrapping UINavigationController myself.

What's interesting is that the SwiftUI environment is still automatically adding nav items to the controller, so I've actually got the same broken animations as with NavigationStack. At least it’s…consistent.

Running out of ideas now 😅

Show thread

Okay, so by adding a .navigationDestination(for:) to the sidebar column, it fixes the content to detail column animation.

However, now the sidebar to content column animation is broken. I've tried fiddling around with .navigationBarTitleDisplayMode(.large), etc. Nada.

I need to lay down.

Here's the exact same code running on iOS 16.2. It works just fine.

And I’m sorry if I sound like a twat, but the SwiftUI team HAVE to get a grip on this. I cannot tell you how many hours I waste wondering "Wait, is that something I broke?!”

I'm being gaslit by a UI framework!

Show thread

Arghhh. Another regression in 16.4: NavigationSplitView won’t animate the first push of the detail column if the content column goes from List, to no List. Again, this worked just fine in prior releases! gist.github.com/phillipcaudell (FB12175649)

On iPad, the suggestions briefly show, then vanish. Why? I have no idea! It never used to do that, now it does.

(It also doesn't show the icon, for...reasons?)

Show thread

On iPhone, the suggestions will appear on presentation (great!), but if you tap a suggestion, then type just a little too fast, the caret position gets messed up.

Do this enough, it'll eventually crash, throwing an exception from some private _UIObscurableTextContentStorage class.

Show thread

Undo/Scheduled Send is one of those features that seems like it would be trivial to implement (just delay sending the message, duh!)

But delay long enough and iOS will kill your app. And if you are terminated, how do you guarantee waking up at the right time to send? There's no public API to do this.

For Big Mail I've had to get creative, ultimately relying on a cloud component.

(Apple Mail is allowed to cheat somehow, of course 🫢)

Show older
The Not So Big Company

The home of The Not So Big Company on Mastodon.