What I am working on
Supercharge your app with Cloud Functions for Firebase
I've been working on an app for tracking links and building up a personal knowledge base. Two features in this app are downloading a cleaned-up, readable version of the HTML, and summarising the article using GPT-3.
This slide deck is for a talk I gave at the GDE Summit Europe in Berlin this week, and it explains how I implemented this functionality using Cloud Functions for Firebase.
I've submitted this talk to a couple of conferences, so if you're lucky, you will get to see it at a conference near you this year.
SwiftUI
Creating Custom SF Symbols
SF Symbols is a fantastic collection of icons for almost any situation, but even though it now contains close to 4500 symbols, you might find yourself in need of a very specific icon that is not part of the collection.
I was not aware that you can create your own SF Symbol, and the process that David Smith describes sounds reasonably simple. There are definitely a couple of icons in one of the apps I am working on that should be trivial to create using this approach.
SwiftUI Views are Lists
Naming is hard, and we can assume that the SwiftUI team went through several iterations for a good name for the View
protocol. In my book, I wrote that "everything is a view - except that it isn't":
However, it is worth noting that when SwiftUI talks about Views, it doesn’t refer to the specific instances of a UI element on the screen, but rather a description of that element. In fact, it might have been easier if the SwiftUI team had decided to say “everything is a view description”—but of course, that’s not as catchy.
In this article, Chris argues that Views
actually are lists, and provides a couple of examples. Thought-provoking, and really worth reading.
Implementing search in SwiftUI
Search is an important feature for any app that shows a list of more than a handful of items. Thanks to the .searchable
view modifier, implementing a search feature in a SwiftUI app is a lot easier than it used to be, and it even got better in iOS 16. Alex goes through some of the new features such as suggestions and scopes, and shows how he used them in his Pulse app.
AI and ML
Swift SDK for OpenAI API
If you want to use OpenAI in your Swift app, you should definitely check out this project by the MacPaw team It supports Completions, Images, and Embeddings, making it easy to do things like:
- summarising texts
- creating images from text
- implementing a recommendation system
Tools
Network Link Conditioner in Xcode
It is a good idea to make sure your app operates well even under adverse conditions, such as bad connectivity, heat, or heavy load. When running on a physical device, you can define those conditions right from inside Xcode, as Adam reminds us.
Comment
It's been a tough week here at Google, and I've thought long and hard about what to write in the intro to this week's newsletter.
If you've been following the news, you will be aware that Google, too, has fired several thousand employees. My Twitter and LinkedIn timelines are full of former colleagues announcing that they were laid off - many of whom I worked with directly. All of these people are incredibly talented and hard-working, and every team can count themselves lucky to have them - so if you're hiring, drop me a note if you'd like to help.
Just like everyone else outside the US, I don't know (yet) if I will be affected as well, as local regulations are different in each country.
Writing this newsletter, creating the sample app and slide deck for my talk at the GDE Summit in Berlin this week helped to take off my mind a bit, and seeing the warm welcome my book received since it was published last week was heart-warming.
That's it for this week. I hope to be back next week with better news and a more up-beat vibe.
Peter