What I am working on
With Firebase Summit looming on the horizon, I am working on a bunch of things that you will be able to see during the keynote and in the pathways that we’re publishing in the weeks ahead of the event.
One of those things is a sample app for iOS and watchOS. I don’t want to spill all the beans here - you’ll have to see for yourselves - but the app makes use of a backend that is entirely driven by Firebase and Firebase Extensions. The client app(s) communicate with the backend via Cloud Firestore, which gives us the nice benefit of a near-realtime synchronisation. So when you make a change in one of the apps (say, on the iPhone), this will be reflected on your iPad almost instantly.
Building the frontend for iOS, iPadOS, watchOS, and macOS was really straight forward, since we were able to reuse all of the existing backend functionality. And thanks to the the Firestore property wrapper we recently added (thanks, Flo!), we can reduce the amount of code you have to write even more.
If you’re interested in a blog or video series that walks you through the building this app, let me know!
Firebase
Firebase Pathways
While all of the pathways cover existing Firebase products, they do hint at features we will be launching at Firebase Summit, so I recommend keeping an eye the event page and our Twitter feed to be the first to get notified when the next pathway launches.
Protect your app from abuse with App Check
Firebase Summit will take place on November 10th (have you signed up yet?), and we’re busy preparing some exciting sessions and demos for you. To help pass the time until the event, we’ve created three brand new pathways that highlight some of our products in a holistic way.
The first pathway focusses on App Check, a new Firebase feature that helps you to protect your backend resources from being accessed by malicious actors.
SwiftUI
EnvironmentValues
I mentioned a couple of environment-related posts in previous issues of this newsletter, and this week the trend continues!
Federico Zanetello of the Five Stars blog continues his series about the SwiftUI environment, and takes us onto a journey into EnvironmentValues and how it works.
If you’ve been a subscriber of this newsletter for any amount of time, you know that I’ve mentioned how important the environment is for SwiftUI quite a few times now - it literally is the reason why you can configure SwiftUI views using view modifiers in the first place. So it is quite interesting to see which environmental values exist. Of course, you could go into the generated SwiftUI interface definition, but that’s pretty tedious. Frederico shows us a better, more elegant solution in his blog post.
I’ve demonstrated how to use the SwiftUI environment in YouTube series Building SwiftUI Components, in which I show you how to build a reusable, configurable text input field with a floating label. Just yesterday, Stewart Lynch took my code and added some new features. Seeing how my work inspires other people to create new things always makes me smile. Check out Stewart’s implementation, and if you’re interested in learning more, watch my video series.
How to make a SwiftUI view to fill its container width and height
This week, I’ve been working on a widget for one of my apps, and one of the first challenges I faced was how to make sure the views in my widget take up the entire height and width of the widget. Here is a useful article by Sarun that explains how this works.
Tools
Instantly parse JSON in any language
In one of my apps, I need to parse some JSON data that the YouTube API returns. Instead of hand-writing all the structs I needed for holding the results myself, I used QuickType. This is an amazing tool that can generate data classes and parsers for JSON for Swift, Java, TypeScript, Kotlin, C#, and a bunch of other languages. Just paste the a sample JSON into the web app, configure some options, and get ready-to-compile code. The Swift code generator makes use of Codable, so the resulting code is concise and easy to understand. Fantastic, and hard to believe this is a free tool!
Using Keynote for code animations
Last week I linked to some articles that focussed on creating content for presentations, and this week I’ve got even more tools for you. I am a big fan of Apple’s Keynote app. You might think “but it’s just a simple slideshow presentation app”, and while you can use it to create simple, yet good-looking slide decks, it is much more powerful. In this thread, Justin Searls explains in detail how he created an animation that looks like the log output of a command line utility. All of it done using Keynote and its built-in animations.
Of course, no presentation would be complete without a diagram, and what better way to show off your inner nerd than using ASCII art diagrams. A few weeks ago I linked to a web-based tool (not surprisingly built by a Google), but for the macOS aficionados among us here is a native app that lets you draw sweet ASCII charts from the comfort of your Mac.
Powerful ASCII art editor designed for the Mac.
Plain text has been around for decades and it’s here to stay. Monodraw allows you to easily create text-based art (like diagrams, layouts, flow charts) and visually represent algorithms, data structures, binary formats and more. Because it’s all just text, it can be easily embedded almost anywhere. Of course, exporting as images is also supported (PNG and SVG).
Create dependency graphs with SwiftPM
f you’re too lazy to draw diagrams by hand, why not let the computer do the work for you? Ole Begemann shows you how to create a dependency graph for your SwiftPM packages.
Conferences
Demystifying Code Signing
I had the pleasure of meeting Josh Holtz at SwiftLeeds, and he knows a thing or two about code signing. If you ship apps to the App Store, sooner or later you’ll have to understand how code signing works. Watch Josh’s i360 talk “Demystifying Code Signing”, and get a head start!
Podcasts
Land of the Giants: This Changes Everything
Early in the pandemic, I picked up two habits: doing a fake commute (essentially walk around my neighbourhood, pretending to go to work), and listening to podcasts while I fake-commute (or do the chores). I’ve listened to more than 1500 episodes of various podcasts in these past 18 months, and over the next couple of newsletter issues, I will share some of the shows and episodes I loved.
Land of the Giants by Vox Media is a fantastic series that looks at some of the Big Tech companies and explores their history. Previous seasons covered Amazon, Google, Netflix, and the delivery service economy. The current season, The Apple Revolution, focusses on Apple and how it went from niche personal computer company to the most valuable company in the world, changing the way we consume music and other media along the way.
Comment
Hello everyone,
I hope you’re having a great and productive week! Did you enjoy Apple’s and Google’s hardware events earlier this week? I am certainly looking forward to cutting down my compile times once I can lay my hands on one of those sweet M1 Pro/Max machines. Although I must admit I was hoping to see them use “time to unpack Xcode” as the benchmark ;-)
This week, I’ve got a fine selection of links about Swift, SwiftUI, Firebase, and presentation tools for you. Firebase Summit 2021 is happening, and there is a bunch of really cool things that the team is getting ready to ship - keep your eyes peeled!
As always, I am keen to hear your feedback, so if you’ve got anything you’d like to share with me, just hit that reply button and let me know! Seriously - I do love hearing from you, don’t be shy!
Thanks for reading, Peter
P.S. if you’d like to say thanks beyond subscribing or sharing this newsletter with a friend, you can now send me a coffee through the internet - isn’t that amazing?