Newsletter: June 2020
đ Hi everyone
With just three weeks to go until the start of this yearâs edition of WWDC, things are busy over here at Sundell HQ. Not only am I going through my regular routine of upgrading all of my projects to the latest Swift and Xcode releases (something that I always recommend doing in preparation for the new beta SDKs), Iâm also building a brand new version of WWDC by Sundell â my dedicated website for covering Appleâs conference and the new technologies and APIs unveiled at it.
This year, that site will be even bigger and more ambitious than last year â with more guest writers, interviews, videos, and the same in-depth code-level coverage of the key conference announcements as last year. I canât wait to show you the new site, which launches on June 17th, and it will once again be completely free and available to everyone around the world.
But for now, letâs get started with this monthâs recap of everything thatâs new on Swift by Sundell. Hope youâll enjoy it, and if you have any questions or feedback, youâre always welcome to reach out.
đ Weekly articles
For 172 weeks, Iâve been publishing a new article about Swift every Sunday. These articles were added during the past month:
The different categories of Swift protocols
Swiftâs many protocols can, in general, be split up into four main categories. Letâs go through them, and how keeping them in mind can help us write well-formed protocols that are consistent with those found in the standard library.
Propagating user-facing errors in Swift
In this article weâll take a look at a few techniques that can make it much simpler to propagate runtime errors to our users, and how employing some of those techniques could help us present richer error messages without having to add a ton of complexity within each UI implementation.
Avoiding deeply nested Swift code
This article contains a number of techniques that can help us make our code easier to read, test and maintain, by reducing the amount of indentation within it. Itâs not just about code style, I promise.
Getting the most out of Xcode Previews for SwiftUI
Letâs take a look at a number of techniques, patterns, and ways of structuring UI code that can help us get the very most out of Xcodeâs SwiftUI-powered preview system.
Designing reusable Swift libraries
My latest weekly article is about library development, and contains a few techniques and principles that can be good to keep in mind when designing and building reusable Swift libraries.
â Basics
With the Basics series, my goal is to build up a comprehensive library of articles that cover most of the core aspects of Swift and iOS development. This article was published during the past month:
Properties
Letâs take a look at a few examples of the various kinds of properties that Swift supports, and what some of their different characteristics are.
đ§ Podcast episodes
The Swift by Sundell podcast is a bi-weekly show featuring special guests from all around the Swift community. You can find it in your podcast player of choice, for example Apple Podcasts or Overcast. These episodes were published during the past month:
72: âMany layers of SwiftUIâ, with special guest Tobias Due Munk
Tobias Due Munk joined me to talk about using SwiftUI to build prototypes, how third party developers can extend SwiftUIâs built-in APIs in various ways, and to discuss the challenges of writing highly dynamic systems in Swift.
73: âTruly a general-purpose languageâ, with special guest Kilo Loco
Kyle Lee, also known as Kilo Loco, joined me to go behind the scenes of Publish â the static site generator used to build Swift by Sundell. Also, how to make a code base accessible to new team members, learning from open source, getting started with Swift-based web development, and much more.
âïž Swift tips
I love to share shorter tips, tricks and techniques with the community. These are the tips that I shared during the past month:
Inferred generic type constraints
How generic type constraints can sometimes be automatically inferred by the compiler, enabling us to omit them within some of our function declarations.
Using test assertion messages as comments
Often when writing tests, we might want to add some additional information to our code, for example in order to give debugging hints in case of a future failure. Letâs take a look at how we can add such information using custom test assertion messages.
Building an Observable type for SwiftUI views
An example of building a reusable ObservableObject
that makes it easy to observe a single value within a SwiftUI view.
Quickly replacing singletons with functions
Testing code that uses singletons may at first seem really difficult. However, thanks to Swiftâs first class function capabilities, there are a few tricks that we can employ to make such code completely testable without having to introduce any new types or protocols.
đș Videos
Swift Clips is a new series of shorter YouTube videos covering Swift tips and techniques. This video was published during the past month:
Key paths and functions
Letâs take a look at how Swiftâs key paths work, and how they relate to functions â both in terms of what comes built into the language itself, and what kind of utilities that we can write ourselves to form some really nice convenience APIs.
â More to read and listen to
Special articles and podcasts that are not part of my regular schedule. Feel free to check them out if youâre looking for something new to read or listen to.
Making Xcode UI tests faster and more stable
In my latest guest article on the Bitrise blog I share my favorite tips and techniques for making UI tests easier to write and, perhaps more importantly, to maintain.
Why does Swift by Sundell not use any client-side JavaScript?
The story of why I chose not to use any client-side JavaScript when building the new version of Swift by Sundell, and why I thought that it was important to emphasize that fact on the website itself.
My origin story on the iOS Dev Discussions podcast
I joined my friend Sean Allen on his podcast to share my âorigin storyâ â that is, how I got started with programming, how writing and podcasting ended up becoming my full-time job, how Iâve been progressing through my career, and examples of the mistakes that Iâve learned from along the way.
Stacktrace
Stacktrace is a weekly podcast that I do with my good friend Gui Rambo, which used to be focused mainly on Apple news, but has since become much more developer-focused â with technical deep-dives and âbehind the scenesâ discussions on every episode.
đ Youâre all caught up!
I hope you enjoyed this summary, and all of the content that I published during May. Like always, Iâd love to hear your feedback â so feel free to either email me, or contact me on Twitter @johnsundell. I read every single piece of feedback that I get, and I try to reply to as many people as I possibly can.
Thanks for reading! đ