What I am working on
BookShelf
I gave a talk about Firebase and SwiftUI at SwiftLeeds myself, and if you’re interested in the slides, you can download them (as PDFs) on Slideshare or SpeakerDeck.
The code will be available on GitHub eventually, but I need to put on some finishing touches first - so if you’re interested in an approach for a multi-platform (iOS, iPadOS, macOS) SwiftUI app that uses Firebase to run the backend, star and watch this GitHub repository to be the first to be notified when I upload the changes for SwiftUI 3 later this week.
Swift
Don’t we all love new APIs and the thrill of using all the new and shiny new features in our apps? Unfortunately, not all of our users will update to the latest version of the operating system - be it because they didn’t turn on auto-update, or because their data rate is so expensive they put off updating until a later time, or maybe their company’s admin policy prevents them from running the latest OS version.
Either way, we cannot always use the latest and greatest APIs in our apps, so we need to find ways to conditionally use them if possible. This week, Dave DeLong and John Sundell share two strategies for back-porting / back-deploying code and making backwards compatibility easier to handle in Swift.
Simplifying Backwards Compatibility in Swift
Every year as new OS and Swift versions are released, the question comes up over and over again: “how do I use this new thing while also supporting older versions?”. While we have a bunch of “availability” tools at our disposal (and I’ll be using them in this post), they always come across as somewhat cumbersome: we need to do inline checks, or we have conditional logic flow that obfuscates the intent of some of our code, and so on.
Which of the SwiftUI APIs introduced in iOS 15 are backward compatible? | Swift by Sundell Which of the SwiftUI APIs introduced in iOS 15 are backward compatible?
Let’s take a look at which of the new SwiftUI APIs that are backward compatible with earlier OS versions, and what language features that made that possible.
SwiftUI
One sign that more and more people are starting to use SwiftUI in their apps is that we see more and more UI components and libraries. Here are three great resources for building better SwiftUI apps:
SwiftUI Library
We’ve rebuilt the most common iOS design components into a library of reusable container views. It’s your design, upgraded with responsiveness and animations that match Apple’s HIG. It’s all one click away with Swift Package Manager. Save weeks of development time - we’ve wrangled GeometryReader for you. 😉
GitHub - CodeSlicing/pure-swift-ui-design
Contribute to CodeSlicing/pure-swift-ui-design development by creating an account on GitHub.
Damir Stuhec on Twitter
Ok, I believe I got it. Here is the #SwiftUI iOS 15 button design system that gives you the freedom to customize native button styles while maintaining all system-provided benefits (rendering, sizing, accessibility, roles, etc.).
🚀 Code: https://gist.github.com/damirstuhec/e232a8d46b79d6c530f657e1460a75f0
Authentication
You might know that I’ve worked on the Partner Developer Relations team at Google before joining Firebase. In this capacity, I worked closely with some password manager apps, and helped them to integrate better with Android’s Autofill APIs and make sure their feedback for our APIs was seen and heard by our engineering and product teams. It is because of this that the following links are near and dear to my heart - making the internet a better place involves better handling of passwords and other secrets. If you’re building an app or a website, don’t compromise your own and your user’s security by trying to prevent your users from using password managers!
App developers: do NOT disable pasting in password fields!
And if you’d like to make a contribution to making the web and apps a safer place, here are two jobs at the teams that have a significant impact - the Authentication Experience team at Apple, and the Web Identity team at Google.
The team I manage at Apple, the Authentication Experience team, is hiring an iOS engineer
Rick Byers is hiring, too:
Think passwords and login forms are dumb? Come work with us to make identity on the web easier to use and more private through projects like WebID and WebAuthn.
Learning
How to learn faster?
If you’re anything like me, you might have noticed that learning new stuff is hard. Have you ever wondered why learning is so hard, and why you can remember some things better than others? The “Cone of Experience” by Edgar Dale provides a simple model to explain this, but - as all simple models - it should be taken with a grain of salt. Here is more reading that provides a more nuanced perspective.
Learn to become a better speaker
In the same vein, there is probably nothing better to truly learn a topic than to write and talk about it - say, at a meet-up or conference! Antoine has written up a really nice summary of his experiences at SwiftLeeds, how his live demo went wrong (but actually didn’t), and he also lets us in on a not-so-secret secret: he wrote a lot of the material on his site to document what he had learned to save his future self (and others) valuable time. That’s a great strategy I wholeheartedly recommend.
Comment
Hi everyone!
I have just returned from SwiftLeeds in the UK. Adam Rush and his team (family, actually) did a fantastic job at organising an in-person conference, and it was amazing to see so many people in one place. I had completely forgotten what an exhilarating experience it is to meet people and talk in person. When I had my 1:1 meeting with my manager later that day, he said “Wow - I haven’t seen you that excited in a long time!”
It was great to meet all the other speakers in person as well after having followed them on Twitter for such a long time. Some truly inspiring talks, and I couldn’t recommend the conference and my fellow speakers higher. I hear Adam is planning to take in community feedback for organising next year’s event - if you can, you should definitely attend.
And with that, enjoy this issue of Not only Swift Weekly! As always, please don’t hesitate to reach out and tell me if you liked it (and if you didn’t - how I can do better next time). If you did like it, pass it on to a friend!
Thanks for reading, and until next week!
Peter