Latest blog post
Improve your app's UX with SwiftUI's task view modifier
SwiftUI's .task
view modifier essentially is an async-ified combination of .onAppear
and .onDisappear
, so why make a big deal out of it?
Well, it turns out you can use it to replicate some of the features known from Combine, so it's definitely worth taking a look. I recently needed to implement a delay functionality to run a piece of code after a short amount of time, and ended up implementing a reusable DelayTaskViewModifier
. Check it out!
Coming up
The conference season is slowly wrapping up, but I will be presenting at a couple of meetups in the coming weeks. I will also be running a series of livestreams, which I am particularly excited about!
Livestream: Building a second brain with SwiftUI, Firebase and Gemini
Join me as I build a "second brain" app from scratch using SwiftUI, Firebase, Gemini, and a bunch of other tools.
In this first stream, I'll talk briefly about the app, and then jump right into coding the UI using SwiftUI.
Save the date for Firebase Demo Day ‘24
Demo Day is back for round two! Mark your calendars for November 19, 2024.
We've got some great content for you, so don't miss out!
Genkit: An introduction to Google's AI Integration Framework
I'll be at DevFest Hamburg on October 19th to provide an introduction to Genkit, Google's AI integration framework.
Join me to learn about its core concepts, architecture, and key features.
There will be plenty of demos, to keep both the audience and me on the edge of our seats :-)
From the community
How to use the safeAreaInset view modifier to implement floating buttons
Did you ever run into a situation where you wanted to float a UI element (e.g. a floating button) above a scrolling view such as a List
view or a ScrollView
, but the bottom element of the list was covered by the floating element?
Check out Sean's quick video to see how you can use the safeAreaInset
view modifier to resolve this issue.
Series: Mastering container views in SwiftUI
What if you could build your own container views?
Container views are a key building block of SwiftUI - it's hard to imagine building any meaningful app without using a hefty dose of HStack
, VStack
, and - of course, ZStack
, to name just the basic ones.
Now you can create custom container views, thanks to new APIs Apple introduced at WWDC 2024.
Majid's blog series provides a clear explanation of the concepts and how to use these APIs:
Dive in to understand how these APIs work and learn how to build your own custom containers (like an accordion)!
How to listen for property changes in an @Observable class using AsyncStreams
In this blog post Pol discusses how to listen to property changes using AsyncStream
. If you've used Combine before, you will appreciate the similarity this approach has to setting up a Combine pipeline.
You might also notice that Pol's implementation is yet another approach to a similar problem I discussed in my own blog post.
Migrating Combine to AsyncAlgorithms
For an even deeper dive into how to migrate from Combine to Swift concurrency, check out Jacob's article, Migrating Combine to AsyncAlgorithms. There's even a before/after project you can follow along as you work your way through the article.
How stuff works
Using electrical debonding to repair iPhone 16 batteries
In issue 66, I wrote about electrical debonding, which allows you to use low-voltage electrical current to "turn off" the stickiness of adhesive tape.
What might sound like a practical joke is actually reality, and Apple is using this to increase the servicability of the latest iPhones.
h/t to Quinn Nelson for finding this in the Apple support knowledge base!
Comment
Hey everybody!
The past couple of weeks have been super busy: I traveled to London to record for Firebase Demo Day (and worked with the rest of the team to bring you cohesive and inspiring content), attended SwiftLeeds to run drop-in sessions for Firebase (thanks for all the feedback you shared with me and Rosário), and worked on a bunch of launches. Really excited to see what you'll build with all the new features!
I've also been enjoying NotebookLM - I think the tag line "Your personalised AI research assistant" fits really well: you can feed the tool any piece of information you like (say, a bunch of blog posts about Swift concurrency, the docs, and even videos and your own notes), and then start asking it questions. But that's not all - you can generate a so-called Audio Overview from the sources you provided. Audio Overviews (or AOs for short) are synthetically generated podcasts - entire based on the material in your notebook. Go give it a try, and let me know what you think!
Peter