How stuff works
Estimating Sleep Stages from Apple Watch
Did you ever wonder how your Apple Watch can tell which sleep state you're in? This paper explains how this is possible.
The algorithm used is based on data read from the accelerometer. This data not only includes large movements that would be visible to the naked eye but also more subtle movements, including those generated from breathing.
Swift
An Introduction to Isolation in Swift
Actors are a Swift concurrency feature specifically designed to make working with shared mutable state safer in multi-threaded environments. Actor isolation means that an actor's internal state can only be accessed from within the actor itself or asynchronously via tasks created on that actor.
This restriction prevents different threads from simultaneously modifying the actor's state, which could lead to data races and unpredictable behavior.
In this article, Matt explains this in more depth, and covers three different kinds of isolation: none, static, and dynamic.
If you use SwiftUI in your app(s), this article is a must-read for you, as "SwiftUI is very confusing". Matt goes as far as saying "right now, if you see a SwiftUI view that is not MainActor-isolated, it’s probably a bug."
SwiftUI
Debugging Techniques - The SwiftUI Field Guide
I know I covered the SwiftUI field guide just the other week, but this debugging section is just too good to not include in this week’s issue.
Chris’ efforts to implement a TypeScript version of SwiftUI really pay off here, as you can interact with the demo in your browser.
AI and ML
What are Tokens?
Tokens are a key concept in generative AI. Other than in programming languages, where tokens match individual semantic units of a program (such as keywords, identifiers, literals, operators, and separators), tokens in LLMs do not necessarily map to words.
In this article, Natasha dives into how tokens in LLMs work, and shows a couple of examples. Really worth reading, no matter if you're just getting started with generative AI, or already have some experience.
Business
MacPaw Announces Upcoming Beta Version of Setapp Mobile
I don't know about you, but when I heard that Apple was going to allow users in the EU to install apps from alternative app marketplaces in iOS 17.4 and later, I was skeptical about who would be interested in operating alternative app stores.
It turns out my doubts were unfounded: MacPaw is no unknown player in app distribution in the Apple world - their SetApp subscription includes a large number of well-known apps (such as Ulysses, Craft, MindNode, Proxyman, CleanShot X, and many others) for the Mac. Building a mobile app store makes a lot of sense for them, as many of the Mac apps that are part of the subscription offer a mobile counterpart.
I'm curious how this will turn out, and if countries outside of the EU will eventually benefit from this as well.
Design
Drams - Framer components inspired by Dieter Rams' principles
If there ever was a collection of lickable UI elements, it's this. Inspired by Dieter Rams' design principles, and augmented with satisfying sounds, this collection of Framer components by Karime and Lee Black is a joy to look at, and very satisfying to use. I could (c)lick those buttons all day long.
Conferences
SwiftLeeds CfP now open
Most conferences give their speakers free access to the entire conference. In addition to this, SwiftLeeds throws in speaker training, slides reviews, and more - check out their CfP page.
If you haven't spoken at a conference before, this is a great opportunity - don't miss out! Adam and his team are some of the nicest people I've ever had the chance to meet, and they've put together an amazing conference these past years.
Podcasts
Google DeepMind CEO Demis Hassabis on the path from chatbots to AGI
If you ever wondered why Google's Gemini is an entire family of models (even with version numbers), and why there is a model named Gemma, you should definitely check out this episode of Hard Fork. Apart form that, Demis talks about the future of AI, not surprisingly painting a positive picture.
Definitely worth listening to if you want to get the perspective on the current challenges and ethical considerations for the use of AI from someone who has worked in the field of AI for several decades.
Comment
Hi everyone!
In this issue of Not only Swift, I've got a broad variety of topics for you, ranging from actor isolation, to SwiftUI debugging techniques, the first alternative App Store to go live that I am personally interested in, some key AI concepts, a new CfP, and some delicious UI elements!
Looking at my submission form for the Hidden Gems category, I get the impression I am doing an extremely good job at digging out cool stuff that you didn't know about - there is no other explanation for the fact that you're not submitting any Hidden Gems, no? Well, I am obviously joking, so please don't hesitate to submit any cool links to articles, videos, SDKs, presentations, podcasts that you love and would like to share with the community. Here is the submission form: bit.ly/not-only-swift-submission.
I am currently in Berlin for a couple of weeks, and would like to connect to the local iOS / Swift community. If you'd like to meet up for coffee (or lunch at the Google office), drop me a line - either here (by replying to this email), or on Twitter, Mastodon, Threads, or LinkedIn.
Thanks for reading!
PS: if you have a friend who isn't already a subscriber, forward them this email so they can become one.
Peter