Out of the box, SwiftUI has a matchedGeometryEffect
modifier that makes it relatively easy to build hero transitions (a style of transition where a new screen is presented and part of the source screen changes position and size to reach it’s place on the new screen). It’s cool that SwiftUI includes this out of the box, but unfortunately it has a few limitations that make it unsuitable for certain use cases. Particularly for me, that it doesn’t work with presenting another view. Most examples on the internet[1] work around this by faking a custom presented view: just slap a full-screen background color down and show your content on top of it. That’s essentially the same as a presenting a full-screen view, with the one major caveat that the pseudo-presented view can only cover the containing hosting controller. And if that controller isn’t full-screen (say, if it’s presented as a sheet), you can’t present anything that’s truly full-screen. So, let’s build a custom hero transition that actually presents it’s content across the entire screen.
swift posts
Subscribe to just swift posts via RSS.
Theming iOS Apps is Still Hard
Sorry to be the bearer of bad news. Last year, Christian Selig wrote a blog post about the annoyances of theming iOS apps. I won’t retread his entire article, but the gist of it is that there is no nice way to easily apply a theme to an entire iOS app. Either every view/controller has to listen for theme change notifications and update itself, or you have to resort to hacky workarounds to force all colors to update[1].
Calling Swift from Rust
From the person that brought you calling Rust from Swift comes the thrilling[1], action[2]-packed sequel: calling Swift from Rust! For a recent project, I found myself needing to call into Swift from a Rust project (on both macOS and Linux) and so am documenting here in case you, too, are in this unenviable situation.
Tusker is Now Available
I am very excited to announce that after almost four and a half years of development, Tusker, my iOS app for Mastodon is now available on the App Store!
If you follow my blog or follow me on the fediverse, you’ve no doubt heard me talk at length about it before, so I’ll spare you the details here. Suffice it to say that Tusker is a completely native iOS app that supports many of the latest features of both Mastodon and iOS.
This is not the end of development, there are still lots of features I plan to add—including push notifications and the ability to edit posts. If you’re already in the beta via TestFlight, you’re more than welcome to remain there. It will continue to get beta updates with new features and bugfixes ahead of the App Store releases.
Live Activities (and Bad Apple)
I recently got nerd sniped by this tweet from Zhuowei Zhang about playing the Bad Apple video in the Dynamic Island on the iPhone 14 Pro. His original implementation used a webpage and the media session API, and this worked, but the system plays an animation when the artwork changes, so the framerate was limited to 2 FPS. Not ideal for watching a video. So, I wanted to see how much closer to watchable I could get.
This post isn’t going to be a detailed guide or anything, just a collection of some mildly interesting things I learned.