Latest blog post
Creating a reusable action menu component in SwiftUI
For an app I am currently working on, I needed an action menu similar to the one found in Apple's Mail app.
The result of this exercise is this blog post which walks you through the process of creating a reusable view modifier that presents an action menu like the one in Apple's Mail app. It covers using view builders, custom view modifiers, custom styles, and more - so even if you don't need a action menu, you might still learn a thing or two.
Coming up
S2 E2: 🤖 Genkit / RAG - YouTube
In season 2 of Building a Second Brain App, we will look at using Genkit to build an AI powered Q&A feature.
Join me on January 21st at 20:00 CET /Â 11:00 PST / 14:00 EST / 19:00 UTC to learn how to use Genkit, Gemini, and Firestore to implement semantic search.
From the community
Solving “Main actor-isolated property can not be referenced from a Sendable closure” in Swift – Donny Wals
I am pretty sure you have run into "Main actor-isolated property can not be referenced from a Sendable closure" if you've turned on strict concurrently checking or Swift 6 language mode for your code base.
Donny walks through several options to resolve this error, and explains when you should use each of them.
I had the opportunity to attend Donny's workshop about Swift concurrency at Do iOS last year, and this is one of the exercises that we worked through. I can warmly recommend this workshop, so if you get a chance to attend it, go for it!
Using withObservationTracking to monitor changes in @Observable properties outside SwiftUI views
The Observation framework, introduced at WWDC 23, was primarily intended to allow for a more fine grained property observation in SwiftUI, allowing SwiftUI to update only the views that required updating.
But Observation can also be used outside the context of SwiftUI. Natalia and Mat wrote about this before, and showed how you can use the Observation framework outside of SwiftUI, and how you can create an AsyncStream from withObservationTracking.
Looking at the signature of `withObservationTracking
, you can't help but think that this was never intended to be used outside of Apple's own frameworks: it's hard to understand what this function really does, let alone how to properly use it. That's probably one of the reasons there are so many blog posts about it...
Pol ran into the same issue, and came up with an improved version of the function that has a much better developer experience. Here is how the call site looks like:
withObservationTracking(of: model.value) {
print($0)
}
Much cleaner, don't you think? Read the full article here.
How to hide private information using the privacySensitive view modifier
In this article, Vincent explains how to use the privacySensitive
view modifier to hide sensitive data when the app goes into the background, and then goes on to show how you can work around some of the limitations of this view modifier by introducing your own custom modifier.
Paul shows how you can use the redactionReasons
environment value to provide a custom layout if the system applies the privacy
redaction reason in this article.
And if you want to prevent the system from taking a screenshot of sensitive views, Giovanni has you covered as well.
Also, did you know you can use isSceneCaptured
to find out if the current scene is being projected (e.g. via AirPlay), mirrored, or recorded?
Podcasts
AI tools for software engineers, but without the hype
In this interview with Gergely Orosz of The Pragmatic Engineer, Simon Willison makes the case for using AI tools as a developer if you don't want to fall behind. He likens the idea of not wanting to use AI for coding to refusing to use a search engine to find answers for your programming questions - "that would set you back enormously".
As I mentioned in the previous issue, Simon has spent an enormous amount of time researching how to use AI for developer productivity, and in this interview he shares his personal AI stack.
If you're not yet sure which implication AI will have on your career as a software developer, you should definitely listen to this episode, it's both enlightening an educative.
Computer History
Apple iPhone was launched - Nokia
What did Nokia think when the iPhone was released in 2007?
This internal presentation, now part of the Nokia Design Archive provides a glimpse into Nokia's competitive analysis at the time (the deck is dated 2007-01-10, a day after Steve Jobs introduced the iPhone at Macworld 2007.
Lots of interesting aspect in there, and many of their predications became true, such as "iPhone may stimulate high-end demand in general", "touch screen UI may set a new standard of state-of-art", or "iPhone has the biggest impact on the definition of coolness".
Nokia saw "Voice as a Killer Application" (slide 17). While the features of the phone app (visual voice mail, easily add other people to a call to set up a conference call) were absolutely mind-blowing at the time, it's funny to see how irrelevant they've become over time (who's making phone calls these days...)
Another interesting tidbit: the brand name "iPhone" belonged to Cisco at the time, and the trademark dispute was only settled shortly after the iPhone was officially launched
Comment
Hello everyone -
Today marks 11 years at Google (yep, these go to eleven), and I'm still loving every single day of it.
What I probably love most about my job is that it allows me to connect with the developer community in so many different ways: be it presenting at conferences, hearing about all the amazing apps you're building and the cool ways you're using Firebase, sharing knowledge by recording videos (or livestreams!), writing blog post and newsletters, building sample code, or hanging out with the community on social media.
Thanks for sharing all your feedback with me, sending your questions, venting about the quirks and bugs in our software, and just being a great community.
Here's to the next 11!
Cheers,
Peter