A list of things in no particular order that would solve problems for me in my current apps. There’s no bearing here on whether I think any of this is actually likely or not. I think most of it is rather unlikely, but we’ll know soon enough. SwiftUI: Dramatically increase APIs available There’s still way too much you can’t do with SwiftUI directly. I’d love to see them come out and double the…
A quick tip that took me too long to realize and easy for someone new to SwiftUI to get stuck on. Say you have a piece of UI where you want to change the background depending on the state. In this case, we want to have no background (using .clear ) or relying on one of the built-in styles like .tertiary or .background or maybe a material like .thinMaterial . Try this out with a ternary operator…
This is the first of hopefully many posts about some behind the scenes things in developing Artifacts , which is a new native image + link organizer for iOS and macOS, currently in beta. When you view an image in Artifacts , we round the corners, give it a border, and add a drop shadow which looks really nice (I can say that since Jordan designed it), especially on iOS. Artifacts item detail on…
SwiftUI previews are one of the biggest advantages of SwiftUI to me, enabling you to build new UI almost as fast as you can type (when they work…). It really can’t be overstated how much creating UI without needing to do a build-run loop improves the developer experience. Besides building the UI though, one thing I rely on previews for is testing how a component looks during a variety of states,…
In my new app Breaks , I’m in the process of adding interactive widgets and hit a subtle issue right off the bat. To add an interactive widget, you can add a Button to trigger an AppIntent . But in what process does that AppIntent run? Well, it depends. The best answer I found is from Michael Gorbach (on AppIntents team) who explains it on Mastodon , but I’ll give you the gist here: If your…
When you share a link using the system share sheet, iOS will automatically fetch the underlying page to get the metadata to render a rich preview for the link. This a problem though for links that require authentication. When iOS tries to fetch it, it will be redirected to a sign in page, and iOS will instead display the metadata for the sign in screen instead of the original link. This makes…
I was recently playing with the ChatGPT API (like everyone else in the world) and hit the point of needing to consume their streaming API in Swift. The API uses server-sent events to stream partial responses so you can update the UI in real-time as the response streams in. This gave me a chance to use a new protocol introduced in Swift 5.5 called AsyncSequence for the first time with URLSession .…
I’ve been experimenting with using SwiftUI for some native macOS apps, and had trouble figuring this out initially. If you want a modern blurred window background for your macOS app from SwiftUI, there’s not a built-in way to do it (or at least that I could find, if there is, let me know!). Luckily, the code to do it is short and simple. First, we need to set the background of the view to a…
Swift playgrounds have been around for years, but I haven’t found them all that useful so far. I’ll spin up a playground now and then when I want to quickly see how a particular api works or iterate on a small function, but they’ve never been a crucial part of my workflow. I was watching a Point-Free episode the other day and I noticed they had a playground in their Xcode project that also had…
Recently, I had to integrate a dependency that wasn’t available via Swift Package Manager (SPM), which is my preferred dependency manager these days. The options available were CocoaPods and manual installation. I didn’t want to add CocoaPods for a for a single dependency, so that leaves manually integrating it. That typically involves manually downloading the framework and vendoring it into your…