What I am working on
Getting started with Google Sign-In on Apple platforms
I've been working on some getting started videos for the most popular Firebase authentication providers, and this is one I am personally super happy about. The previous version of the video was well past beyond it's use by date (in fact, it was recorded when UIKit and Objective-C were the only way to build UIs for iOS).
We've recently made a couple of changes to the Google Sign-In SDK that improve the developer experience. For example, you now no longer have to use incremental auth to request additional scopes. This is great news for anyone who wants to use the Google Sign-In SDK to access the user's data in services like YouTube or Google Drive. Another change is how the SDK reads the client ID - you can now put this into your app's Info.plist
file, where the SDK will retrieve it automatically. The old way of reading it from GoogleService-Info.plist
still works, and in the video I show you both ways.
Which other authentication methods would you like to see videos for? Let me by hitting reply, or answering this poll.
Firebase
Manage data retention with TTL policies
Giving your Firestore documents a time to live (TTL) is something that can be useful for a number of use cases: imagine implementing an app that allows users to send messages that expire after a certain amount of time. Or maybe you want to send an invite for a special deal that expires after a few days.
In the past, you would have to implement all of this yourself (see How to schedule a Cloud Function to run in the future with Cloud Tasks (to build a Firestore document TTL).
Thanks to Firestore's support for TTL, this is now a lot easier. You can define a TTL policy for document groups and collections, based on a timestamp field of the documents in the collection. Check out the documentation for more details.
Swift
How to use custom names for Swift properties when decoding JSON data
Swift's Codable
protocol makes mapping JSON a lot easier than it used to be (there was a time when it felt like someone released a new JSON mapping framework literally every month).
But sometimes the attribute names in the JSON you want to parse are different from the property names of your Swift structs. Natascha gives a quick overview of how you can specify how to map from user_name
in your JSON to userName
in your Swift struct.
BTW - Firebase also supports Codable in many of our APIs, for example making it easier to map Firestore documents. For more details, check out our documentation
SwiftUI
Whatβs New in SwiftUI iOS 16.4
Alessandro Manilii wrote a nice summary of the recent additions to iOS 16.4 beta. It covers:
- Using
print
in SwiftUI previews - Adjusting scroll bounce behaviour
- The new
sheet
view modifiers - Back deploying functions
aheze/Setting: Compose beautiful preference panels.
Andrew Zheng released this cool SDK for creating settings screens in SwiftUI. It makes use of Result Builders, resulting in a really intuitive syntax. Can't wait to use this in my own apps!
The making of Ice Cubes, an open source, SwiftUI Mastodon client
I wrote about Thomas' Mastodon client, Ice Cubes, in previous episodes. It's a really nice Mastodon client, built entirely in SwiftUI.
In this article, Thomas shares how he came up with the idea to write a Mastodon client. He also provides an overview of the layout of the source code, the architecture of the app, and explains how the he implemented the navigation. Ice Cubes is quite a complex app, and it's great to get some insight into how it was built.
@backDeployed: Could SwiftUI be backward compatible?
In the previous issue I predicted that Apple is going to make SwiftUI backwards compatible (thanks to the new @backDeployed
attribute). Daniel explains how @backDeployed
works.
Productivity
The Fun Way to Visualize Long Builds in Xcode with π
Raycast is one of my favourite productivity apps on the Mac (I've used QuickSilver and Alfred before). Here is a cool tip from @heydavut that shows how to trigger Raycast's confetti canon when an Xcode build succeeded.
Make your terminal tell you when it's done
Jesse Squires shows another fun way to alert you when a long running process has finished - using the built-in say
command.
Of course, instead of making macOS talk to you, you can just as well use the confetti command from the previous article to let Raycast throw some confetti when your long-running shell command has finished.
Comment
My newsletter stats show me that most of you are interested in SwiftUI, so I decided to put as much SwiftUI into this issue as possible. Your wish is my command :-)
But there are some other topics as well. I am a sucker for anything related to productivity, and this time I've got some productivity tips that are also fun!
Speaking of productivity - I've got a bunch of videos in the pipeline that are just waiting to be edited, and I hope to sit down next week and put together the screencast tracks and do the rough edit before handing it off to our editing team. I'll let you know how it went in the next issue!
Peter π₯