Swift
Using count vs isEmpty to check whether a collection contains any elements
John Sundell published a great article this week that demonstrates that itās indeed useful to pay attention to the runtime complexity of an algorithm. Thankfully, many of Appleās APIs contain information about the runtime complexity of certain methods, and itās well worth your time to read them and be aware of the implications.
To check your own code and see where where you used count instead of isEmpty, check out this handy tip by @thecraftybrit.
SwiftUI
Turning SVG shapes from Figma to SwiftUI
I mentioned @mengto last week already, and this week he shared a nice trick to take SVG shapes from Figma and turn them in to SwiftUI Shapes.
If youād like to try if for yourself, here is the tool he used. My quick experiment with the SVG Tiger looks promising (but also - more than 2400 lines of codeā¦).
Productivity
M1 Max vs Xcode - Worth Upgrading as an Xcode Developer?
Speaking of timing, @codeslice just released a great video in which he benchmarked his new M1 MBP (fully specced-out!) against his previous Mac Mini. As always, itās produced to Adamās amazing standards, and I was impressed by the dedication he put into making sure the numbers are correct. Definitely check out the video, you might be surprised about some of the results!
Of course, I couldnāt resist reaching out to Adam to ask if he could run some additional benchmarks for me, and he agreed - thanks again, Adam!
The benchmarks I asked him to run are: * Performing a clean build of MakeItSo (my replica of Appleās Reminders app) * Performing an incremental build of the same code
This is especially interesting for those of use who use Firestore, which is known to increase build times quite a bit.
So, thanks to Adam giving up his lunch break, please enjoy the following diagrams which demonstrate how much time you will save by getting yourself a shining new M1 MBP!
Itās quite impressive to see the build times cut in half on an M1-based Mac. The good news for those of us who might not upgrade to a new machine just yet is that the incremental build times arenāt too bad.: 10.5 seconds on a MacMini vs. 5.5 seconds on an M1 Max. Ten seconds are just enough time to take a sip of tea or coffee, and as we all know, itās important to stay hydrated š§
networkQuality
Speaking of benchmarks, @justsitandgrin discovered macOS Monterey includes a command line utility for measuring network quality - nice!
Podcasts
Why ABBA songs just hit different
No matter if youāre a fan or not - I am pretty sure you know Swedish supergroup ABBA and will have listened to at least a few of their songs. In this episode of Switched on Pop, Nate and Charlie go through just why ABBA became so successful, and why their songs just hit. Definitely worth listening, even if youāre not a fan!
Comment
šš» Hello everyone!
Itās Firebase Hackweek: everyone on the Firebase team gets to work on something they donāt usually work on, and at the end of the week, we have an internal presentation to demonstrate what weāve achieved. Some of these projects are purely internal, but some of them might actually be launched as public features (after receiving some polish, code review, and a proper launch process), so who knows - maybe you will be able to use what @mbleigh and I have been working on this week in the not-too-distant future! Itās something a lot of people have asked us for - that much I can tell you!
If you want to venture a guess, you can always send me an email, or DM me on Twitter (my DMs are open).
I hope you enjoy the articles, videos and libraries as much as I did curating them! As always, donāt forget to let me know if you liked the newsletter (thereās a little yes/no link at the end), and if you did, share it with a friend. If you didnāt like it, why donāt you write me a quick note what youād like to see improved, and Iāll try to do better next week!
Thanks for reading,
Peter š„