Weekly Swift articles, podcasts and tips by John Sundell.

Newsletter: April 2020

Published on 01 Apr 2020

Here’s a quick summary of all Swift by Sundell content from the past month — 14 different articles, videos and podcast episodes. Feel free to share your favorites to help support the site, if you’d like to 🙂.

📖 Weekly articles

For 163 weeks, I’ve been publishing a new article about Swift every Sunday. These articles were added during the past month:

Splitting up Swift types

This article covers a few tips and techniques that can help us make our types more well-defined, by splitting them up once their responsibilities have started to grow beyond the ideal scope of a single type.

Avoiding massive SwiftUI views

Let’s explore the topic of UI modularization in the context of SwiftUI, by taking a look at a few different techniques that can be useful in order to avoid trading Massive View Controllers for Massive Views.

Writing small utility functions in Swift

A look at how even the smallest utility functions can have quite a big impact on the way we write code on a day-to-day basis, by making common tasks easier and preferred patterns simpler.

A guide to the SwiftUI layout system - Part 1

In my new three-part article series, we’ll explore the SwiftUI layout system by building a full-screen view from scratch. Along the way, we’ll use many different techniques and APIs, which lets us look into the underlying rules of the SwiftUI layout system.

A guide to the SwiftUI layout system - Part 2

In part two of my new series about SwiftUI’s layout system, we’ll take a look at a couple of more advanced layout techniques, such as how we can align views with dynamic dimensions and how to read a view’s geometry in order to build custom layouts.

✅ 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. These articles were published during the past month:

The Result Type

A look at the standard library’s Result type, what kind of situations that it might be useful in, and tips and tricks that can be good to keep in mind when working with it.

🎧 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:

68: “MVPs and prototypes”, with special guest Leah Culver

Leah Culver, co-founder and CTO of the Breaker podcast app, joined me to talk about her journey from iOS developer to startup founder, building MVPs and prototypes, iterating on and maintaining a code base, and growing a development team. This episode contains lots of tips and learnings about everything from app architecture to hiring.

69: “Swift Playgrounds”, with special guests Holly Borla and Grace Kendall

Holly Borla and Grace Kendall, both software engineers at Apple, joined me to go on a deep dive into the Swift Playgrounds app and Swift 5.2’s new diagnostics engine. Also, how Swift Playgrounds was ported to the Mac using Catalyst, and Swift’s role in education and as a language for beginners.

⭐️ 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:

Using Swift’s built-in randomization APIs

Using the standard library to generate random numbers and pick random collection elements, and a few tips that can be good to keep in mind when doing that.

When can a struct’s memberwise initializer be used?

How Swift’s memberwise initializers work, and the type of contexts in which those initializers can be used.

Making properties overridable only in debug builds

Implementing a property wrapper to enable certain properties to be overridden only in debug mode.

Explicit type annotations

Giving the compiler a helping hand by adding type annotations to closure-based generic code.

Inline wrapping of UIKit or AppKit views within SwiftUI

A really convenient wrapper that enables either UIKit or AppKit views to be directly imported into a SwiftUI hierarchy.

📺 Videos

Swift Clips is a brand new series of shorter YouTube videos covering Swift tips and techniques. These videos were published during the past month:

Managing URLs and endpoints

In this video, we’ll take a look at three different ways to manage the URLs and server endpoints that a Swift app is communicating with, and the sort of pros and cons that come with each approach.

🙌 You’re all caught up!

I hope you enjoyed this summary, and all of the content that I published during March. 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! 🚀