View profile

🪄 🕺🏻 (Magic Move) - Not Only Swift Weekly - Issue #8

Peter Friese
Peter Friese
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?

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!
Swift
I had the pleasure of meeting Josh Holtz at SwiftLeeds the other week. Josh is not only a super nice guy, he is also the lead maintainer of fastlane, 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!
Josh “so many typos” Holtz 💪🚀
🚨 My @360iDev talk on “Demystifying Code Signing” is live 😱

👉 https://t.co/DwUD9s65q9

I hope you all enjoy my madness 😈 https://t.co/xE9TEU3msH
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!
SwiftUI
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.
EnvironmentValues | FIVE STARS
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.
StewartLynch
@peterfriese has an excellent series on YouTube on building SwiftUI components where he creates a floating label for TextViews. I have extended this to provide for secure fields, different size categories and added a rounded rectangle type border style.
https://t.co/vxnq0bWSi0 https://t.co/iyAYatn6pX
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.
How to make a SwiftUI view to fill its container width and height | Sarunw
Firebase 🔥
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.
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.
Presentation Tools
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.
Justin Searls
Here's another Keynote demo. My goal was to display a terminal command in the center of the slide in large type, then print its full output without interrupting the visual continuity (i.e. without forcing your eyes to make the jump to the top of the slide). https://t.co/4FwDnxmqFC
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.
If 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:
Ole Begemann
Today I learned that SwiftPM can produce a package dependency graph you can feed into graphviz for visualization. Example for AsyncHTTPClient:

$ brew install graphviz
$ swift package show-dependencies --format dot | dot -Tsvg -o graph.svg https://t.co/3FVAXEtf8i
Podcasts
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.
Land of the Giants: This Changes Everything (33m)
Did you enjoy this issue? Yes No
Peter Friese
Peter Friese @peterfriese

Xcode tips & tricks, Swift, SwiftUI, Combine, Firebase, computing and internet history, and - of course - some fun stuff.

In order to unsubscribe, click here.
If you were forwarded this newsletter and you like it, you can subscribe here.
Created with Revue by Twitter.