Firebase
What's new in Firebase for building gen AI features
At Google I/O, we not only updated the Firebase logo (how to do you like it? Let me know!), but we also launched some entirely new products and a slew of new features.
For an overview of all the new AI features, check out this video in which my colleagues Marina, Puf, and Rich walk you through Vertex AI for Firebase, Checks, Firestore Vector Search, Firebase Data Connect, Genkit, Gemini in Firebase, and some of the new features we added to the Firebase Client SDKs.
For all the other updates we announced at Google I/O, here is a playlist with all the videos: Firebase at Google I/O 2024
How stuff works
NASA’s Voyager 1 Resumes Sending Engineering Updates to Earth
I know we always complain that debugging apps on our phones is not a great experience due to the latency induced by the device-to-device communication. But how about debugging and patching a computer program on a machine that is 24 billion kilometers away from you, travels at a speed of 61,500 km/h - resulting in a roundtrip latency of 45 hours(!)...?
This is exactly what NASA did to revive Voyager 1 when they found out that there was a faulty chip, and they had to move all the code to a different location on the probe's computer...
Watch this episode of the Hardfork podcast for an interview with Todd Barber, Propulsion Engineer at Jet Propulsion Lab: How NASA fixed an ancient spacecraft 15 billion miles away
Deploying on a Friday sounds like a walk in the park in comparison...
Swift
Swift Gems
Swift is a very powerful language, and there is a ton of resources about the language and how to use it. The Swift Programming Language is a great resource and covers the entire language, and it's a good idea to read it at least once to get an overview.
Natalia recently published Swift Gems, a collection of more than one hundred tips and tricks. It's a great addition to the Swift Language guide, and will help you become a more efficient Swift developer.
For a sneak peak, there is a sample chapter.
If you'd like to buy the book, I have good news for you - you can use the following discount code to get the book at 30% off: NOTONLYSWIFT. This code will work for the first 30 people who use it - so you better be quick!
For a larger discount, RT this tweet - the first 10 people doing this will get a 50% discount code (make sure to follow me @peterfriese, so I can DM you the code).
SwiftUI
Creating Shapes from SVG in a SwiftUI app
In SwiftUI, you can use primitives like Rectangle
, RoundedRectangle
, Circle
, Ellipse
, and Capsule
to create shapes, but often, using a Path
gives you more flexibility.
Now, obviously it's rather cumbersome to manually create paths. This is where Pasquale's article comes in. He shows how to use SVG to SwiftUI Converter to convert SVGs into SwiftUI paths.
My attempt to convert the Ghostscript tiger turned out to be less than satisfactory, but admittedly that's probably not what you would use this for. It works great for icons and other vector artwork created in tools like Figma.
Other tools in this space include Paintcode (although it doesn't support SwiftUI), and Kolibri
Deciding between a computed property and a function in Swift
Should you extract code into a computed property or a function? Donny walks us through his thought process for making that decision.
This is also highly relevant if you're building SwiftUI views, as you sometimes want / need to extract code into view builders. In my talk "Building Reusable SwiftUI components", I recommend putting simple code that doesn't need to be parameterised into computed properties. If you need to use parameters to customise the contents of a view, you're better off using a function (with parameters).
Here are the sections in my tutorial that walk you through the process:
How to dismiss a multiline SwiftUI TextField by pressing the return key
You should think that dismissing the keyboard on a TextField
is an easy task, and you would be forgiven for thinking so. But it turns out that this is a bit of a challenge for multi-line TextField
s, as Daniel explains in his article. But it wouldn't be Daniel if he didn't find a solution for the problem...
AI and ML
Creating an LLM-powered text adventure with Gemini and Swift
Here is a quick thread to show how you can use Gemini to build an LLM-powered text adventure using Gemini and SwiftUI. If you'd like to dig deeper, we also created a guide to walk you through this, including a video that shows how to implement chat experiences with Gemini.
Productivity
Adding Custom Shortcuts To Xcode
This is a nifty trick by Aryaman for adding keyboard shortcuts for menu items that don't have a shortcut assigned. Also works for other apps!
Comment
The past couple of months leading up to Cloud Next and Google I/O have been super busy for me - I worked with several of our teams to bring you some of our exciting launches, such as:
And there is more... For example, we're still busy finishing work on the Swift SDK for Firebase Data Connect - if you're attending I/O Connect in Berlin (June 27th), make sure to come to our workshop "Introduce generative AI into your app with Firebase Data Connect and Vertex AI" to see how we use Firebase Data Connect and Vertex AI to create a movie tracking app.
Oh, and of course, there will be more videos... So let me get back to editing them :-)
Peter