Firebase
What's new in Firebase @ Google I/O 2023
We shipped a bunch of exciting updates for Firebase at Google I/O this year. I'll let you read the entire article yourself, but here are my personal favourites:
You might have noticed that Google I/O was all about AI. To make it easier than ever to integrate AI into your apps, we have shipped some Firebase Extensions powered by the PaLM API. Fireship has an impressive video that shows how to use these extensions in your own app in less than 2 minutes.
You can now build Firebase Extensions yourself and ship them to the Firebase Extensions Hub. To learn what Firebase Extensions are and how you can build them yourself, check out this video
It's now possible to send Remote Config updates to your app in real-time. And - great news for iOS developers - we've got a property wrapper that makes it super easy to use this in your SwiftUI views:
import SwiftUI
import FirebaseRemoteConfig
import FirebaseRemoteConfigSwift
struct BookingScreen: View {
@RemoteConfigProperty(key: "buttonColor", fallback: "#D1B000")
var buttonColor: String
var body: some View {
Button(action: {} ) {
Text("Book")
}
.tint(Color(hex: buttonColor))
.onAppear() {
setupRemoteConfig()
}
}
private func setupRemoteConfig() {
let remoteConfig = RemoteConfig.remoteConfig()
remoteConfig.addOnConfigUpdateListener { configUpdate, error in
guard let configUpdate, error == nil else { return }
remoteConfig.activate()
}
}
}
Computer History
The two computers that made Apple
This episode of The Vergecast is about two computers that shaped Apple like no other: the Apple II and the Lisa. In the first part, you will hear an interview with Laine Nooney, author of the book The Apple II Age: How the Computer Became Personal (affiliate link). It's a fascinating story about the hardware and how the software helped people understand what they could achieve with a computer and why they needed one.
The second part of the episode is about a documentary about an Apple reseller and how thousands of Lisas ended up in a landfill in the middle of Utah, and I recommend listening to both the podcast (as a behind-the-scenes experience) and watching the documentary.
Swift
Swift Macros: Extend Swift with New Kinds of Expressions
Swift Macros allow you to extend the Swift compiler by transforming code that is annotated using freestanding or attached macros.
This article is an excellent read if you didn't find time to watch the two WWDC sessions about Swift Macros (Write Swift macros and Expand on Swift macros), and provides a good overview of what macros are, how you can use them in your code, and - most importantly - how to implement them.
At Firebase, we've started looking into Swift Macros for a couple of things. For example, they might be an elegant way to implement an ergonomic API for writing Cloud Functions in Swift (if you care about this, be sure to vote on this feature, so we can prioritise it).
krzysztofzablocki/Swift-Macros: A curated list of awesome Swift Macros
A curated list of awesome Swift Macros. Contribute to krzysztofzablocki/Swift-Macros development by creating an account on GitHub.
There are a bunch of other GitHub repos out there that started collecting Swift Macros, but - this coming from none other than Krzysztof Zabłocki, who brought us Sourcery - I assume this repo will become the canonical collection of everything Swift macros.
SwiftUI
iOS 17 @Observable and the Observation Framework
A quick look at the new Observation framework and what is the magic that allows SwiftUI (and your own code!) to run updates only when specific properties have changed.
This is a departure from how state management used to work in SwiftUI, and it will be interesting to see how this new approach changes how we build apps in SwiftUI.
Observation x SwiftUI
Here is another look at the Observation framework, with a slightly different angle. Alex takes a piece of SwiftUI code that uses Combine and gradually turns it into code that embraces @Observable
, and @Bindable
- quite useful for those of us who've been using Combine (or aspects of it) in their apps.
A Deep Dive into Observation
This article is a deep dive into how the new Observation framework works like. It starts with explaining how the status quo works, goes on to show a couple of usage patterns for the new @Observable
macro and @State
and @Binding
property wrappers, and finally discusses how and when to use withObservationTracking
(and how it is likely being used in SwiftUI itself).
Well worth a read, even though it's on Medium.
Productivity
Your Meeting Needs a Google Doc
This article describes why adding a meeting notes document to your calendar invite can help make your meeting more efficient - to the point where the entire meeting becomes obsolete because all questions were answered before the meeting even takes place.
I can confirm that adding a meetings notes document (and an agenda!) can help make your meetings more efficient and help you (and your peers) better remember what you discussed half a year ago and why you made certain decisions.
Finish your projects
This article is useful for anyone who's working on a (side-)project. It goes over * how finishing a project is different from solving the problem you set out to solve * what role fear might play in limiting you from reaching your potential * what you stand to gain by seeing a project through to the end
This stood out to me:
For every vocal critic, there are ten times as many people quietly following along and admiring not only your work but your bravery to put it out publicly. Let that be an encouragement.
This also applies to speaking at conferences, by the way! So if you think that you don't have anything to say or that other people are more expert than you are - don't let your inner critic keep you from submitting that abstract! There are people out there who will benefit from your story, from your perspective, and from your very personal approach to solving a problem.
Comment
The past couple of weeks have been quite hectic, with a lot of conferences and even more exciting new releases (among other things, I wrote and shipped the Swift SDK for PaLM). I am looking forward to the next few weeks, when I will have plenty of time to try out all of the new APIs and features that Google and Apple have released at their flagship events.
I had the chance to catch up with Morten and Flo in Amsterdam at Google I/O Connect. We discussed that WWDC week is pretty intense and can easily make you feel that you absolutely need to watch all the videos, try all the samples, and create as much content as possible. It sometimes feels like we're all in a WWDC-induced frenzy... So it's worth keeping in mind that you've got more than enough time to digest the new material, try out new APIs, and start adding it to your apps before most users can use it on their devices.
Before you skip to the main content of the newsletter, I have two questions for you:
Let me know what you think by voting here and here.
Thanks!
Peter