Firebase
Using Cloud Firestore in your iOS apps
We recently shipped a video about Cloud Firestore that walks you through all relevant aspects of using Firestore in your iOS app - from creating the database, creating, updating, deleting, and synchronising data in real time to adding this to SwiftUI with just one line of code.
If you'd like to learn more about using Firestore in SwiftUI apps, check out the workshop I will be running at SwiftHeroes in April (skip ahead to the end of this newsletter for a chance to win a free ticket for this workshop).
I am putting the finishing touches on a video about Cloud Storage - stay tuned!
How stuff works
ASML's new $380 million photolithography machine
Have you ever heard of ASML? This little known company based in Veldhoven in the Netherlands creates some of the most important machines for creating chips.
The photolithography machines produced by ASML are used to create patterns on silicon wafers, which are then used to produce the chips that power a wide range of electronic devices.
In fact, they are the only company in the world that makes these machines
You can learn more about ASML in The most important company you never heard of! - Sify, and in this Decoder episode with Professor Chris Miller (author of Chip War).
SwiftUI
Dependency Injection for SwiftUI Applications
This article provides a really good overview of different Dependency Injection approaches (mostly for SwiftUI apps), and I would encourage you to read it - specifically if you think you don't need DI in your app(s).
Compile-time safety is one of the aspects that Lucas shines a light on, and I found this particular section to be very enlightening:
The compiler is a great tool to validate the correctness of your program. In fact, the number one feature that makes Swift developers wish they could use their language everywhere is the compile safety guarantees that the language gives. When you use the language idiomatically you will not see any nil pointer or type related crashes at run-time. Game changer!
[...]
A compile-safe DI solution ensures that if the application compiles, all DI requirements will be guaranteed to be set when the applications runs.
This immediately rules out @EnvironmentObject
, as it does not enforce setting dependencies, potentially resulting in pretty embarrassing runtime crashes.
In addition to describing the general approaches to Dependency Injection, Lucas takes a look at a couple of techniques and DI frameworks (singletons, manually managing your dependency tree, @EnvironmentObject
, Factory, TCA, and Needle), and concludes with some useful recommendations.
AI and ML
Harness the Gemini API in your Dart and Flutter Apps
I recently linked to a Dart SDK for Gemini built by a community member. Since then, the Gemini SDK team has implemented an official version of the Gemini SDK for Dart, making it easier to use the Gemini API in your Flutter apps.
This article by Ander Dobo provides a really good overview of what you can do and how you can use the Dart SDK in your apps.
To get started, check out this quickstart.
Productivity
Automating DocC for a Swift Package with GitHub Actions
I use DocC for a bunch of interactive tutorials, and - just like Daniel - have been building them manually, which is pretty cumbersome.
Being able to build (and deploy) them automatically using GitHub Actions will make my life a lot easier. Thanks, Daniel!
Business
Simplify app installs on X/Twitter
In this article Swift Dev explains how to share a link to your app that shows an install button on the user’s stream on X/Twitter.
It’s just a few steps, and - thanks to hosting your app’s landing page on GitHub pages - even free to set up.
Apple to allow iOS app downloads direct from websites in the EU
When I read the headline of this story, I first got pretty excited - it sounded like a great idea for people who, like me, build samples apps as part of blog posts, videos, and other DevRel material. Wouldn't it be great to add an install button at the end of a blog post, a video description, or in the README of a GitHub repo?
However, my hopes were dashed after reading the first two bullet points:
- "Be enrolled in the Apple Developer Program as an organization incorporated, domiciled, and or registered in the EU [...]"
- "Be a member of good standing in the Apple Developer Program for two continuous years or more, and have an app that had more than one million first annual installs on iOS in the EU in the prior calendar year.
Getting a million installs for a sample app - not going to happen. Web Distribution in the EU is intended for other use cases, and I am curious to see which app developers will take advantage of this distribution channel.
Design
Live generate SwiftUI code by drawing the UI with a pencil
SwiftUI makes building UIs a lot easier than this used to be in UIKit, but sometimes you just want to quickly sketch out a screen real quick to try out an idea.
This prototype looks like something that could dramatically increase turnaround times for prototyping UIs.
Conferences
Make It So: Building a Productivity App with SwiftUI and Firebase
I am super excited to run a hands-on workshop about SwiftUI and Firebase at Swift Heroes 2024 on April 17th (that's on the day before the main conference).
As a subscriber of my newsletter, you have the unique opportunity to win one of two free tickets to this half-day workshop.
For a chance to win, here's what you need to do:
- Like and re-post this tweet.
- Reply to this email, and tell me which part of the workshop you are most excited about (please include your Twitter handle), and what you hope to get out of the workshop.
I will randomly select two lucky winners on April 1st, and will notify them by email.
Please keep in mind this is a hands-on, in-person workshop - so to be fair to all other readers of the newsletter, please only take part if you can actually travel to Turin and take part in the workshop on April 17th, 2024.
If you don't want to test your luck, you can always book a seat using the tickets button on the conference web site - but don't hesitate too much: there's only 20 seats in total!
I look forward to seeing many of you there!
Comment
Just the other day, someone on Twitter/X mentioned that it seems like the Firebase Apple SDK doesn't support the Codable protocol for Cloud Functions. I was a bit surprised to read this, as I've been using Codable in all of my apps when calling Cloud Functions. After looking at the code, and digging around in the GitHub issue tracker (Issue #8528 and PR #8854), I was able to confirm that we do support Codable when calling Cloud Functions. Here is a slide from a recent presentation I gave that shows how to use it.
If you ever have the impression something is missing in one of the Firebase SDKs, here is what you can do:
Oh, and just like most other open source frameworks, we love contributions, so if it turns out the feature you're looking for is actually missing, and you would like to contribute - tell us! There are a bunch of amazing features that were contributed by members of the community, and the majority of them started as a FR, and were a close collaboration of one or more community members with the Firebase team.
Peter