Subscribe for weekly commentary and coverage of Swift and Apple platform development. Written by Dave Verwer and published every Friday. Free.

Picture of Dave Verwer

Issue 655

5th April 2024

Written by Dave Verwer

Comment

Did you see the new Swift tutorials Apple released this week? It’s great to see more official tutorials appear, especially ones like these that target people brand new to programming, but as I was browsing the first tutorial it struck me what an amazing first introduction to programming this would be. The code in the tutorial was so clear and readable, and unlike Swift Playgrounds (which is great in its own way) these tutorials have you building an iOS app within minutes of opening the first tutorial. That’s incredible.

Before Swift arrived, I used to teach in-person training courses covering Objective-C and UIKit development. But even requiring a pre-requisite of being comfortable with developing in any other programming language, the first day of the course was learning Objective-C. There was just too much legacy knowledge from C needed to tackle it at the same time as dropping a firehose of UIKit on people. It all falls apart so quickly when you need to stop teaching UIKit to explain what an NSNumber is and why you need a pointer to one so you can wrap an int up before passing it to an API.

But look at that last screen of code from this tutorial. It’s so readable. That’s not just because of SwiftUI, it’s even just Swift, that’s years of progress and centuries of person-hours that have gone into taking us from needing a very dry day (or more!) of learning about pointers and why NSNumber is even a thing ten years ago, to this today. 🤯

Like many of you, I also have concerns about how complex Swift has become over the years, but there is none of that in sight when you start out. It was a lovely reminder that the complexities of worrying about strict concurrency warnings, typed throws, and non-copyable generics is not what people are faced with as they first approach the language and I’d like to take a moment to congratulate everyone involved with the last decade or more of progress that made this tutorial possible. I’ve not seen it in quite such a striking way as this before.

Dave Verwer

50+ CI/CD Workflow Recipes for Peak Performance

Explore Bitrise’s curated workflow recipes, designed to speed up your mobile projects and improve performance. Download now.

News

Embedded Swift on ARM and RISC-V Microcontrollers

Work on embedded Swift has been progressing for quite some time now, but you might be surprised at the range of very tiny devices it now runs on. I had only heard of the Raspberry Pi Pico from this list, but there are many more. Kuba Mracek fills us in on where things are and introduces the new embedded examples source code repository!

Tools

Xcode Bookmarks

I’ve written before about my struggles getting into the habit of using the new Xcode bookmarks feature, but this article from Keith Harrison made me think about them differently. Not as something you’d set up while working on a single feature or bug fix, but as a more permanent guide to the interesting and commonly visited pieces of a codebase. It’s time to give them another try!

Code

Quick and Painless Persistency on iOS

SwiftData is significantly easier to adopt and use than Core Data, but I’m still a fan of considering other options for small amounts of data storage before reaching for something that complex. Jordan Morgan goes through a greatest hits of all the methods that are worth considering before breaking out a database or ORM.


In Search of a Smooth Scroll

I love this post from Edvinas Byla on dropping back to AppKit to polish up an area of his app. You should read the whole piece, but make sure to read the conclusion as I’ve not seen a fairer examination of the SwiftUI vs AppKit/UIKit debate yet. He nailed it. 👍


App Store Subscriptions and Family Sharing

If you used Apple’s sample code for StoreKit, you might also have the bug in your subscription code that Craig Hockenberry talks about in this post:

That code will work fine until you encounter a customer that has Family Sharing enabled, as most do. The issue is that the Product.SubscriptionInfo can contain multiple items, and the code above only checks the first one.

It might be worth checking!


How to avoid using AnyView in SwiftUI

The title of Natascha Fadeeva’s post says it all. She goes through three ways to avoid falling back to AnyView in this post. 👍

Videos

Apple Developer channel on YouTube

What’s that? Is it a new Apple Developer YouTube channel a couple of months before this year’s conference with a load of WWDC 2023 videos already uploaded? I wonder if we’ll see quick uploads of this year’s session videos or even simultaneous distribution alongside the official site?

Jobs

Senior iOS Engineer - Voloco @ Resonant Cavity – Voloco is the best mobile recording studio in the world! Small profitable company with an Engineering driven culture. We ship with minimal process and meetings. You’ll work closely with the founders, who still regularly commit code. – Remote (within US timezones) with some on-site work (United States in CA or MN)

Don’t forget to post any open positions you have available on iOS Dev Jobs!

And finally...

and beyond!