Snapp Mobile iOS Newsletter

Issue 15 • November 8, 2024

Hi again,

We’ve been migrating some tests to the new Swift Testing framework recently. As we started researching around the framework, we found some fantastic resources from Majid Jabrayilov that we wanted to share with all of you.

Enjoy!

Swift

Build a Command-line Tool

Command-line tools can be useful for many reasons. While Unix (and macOS) comes with a plethora of command-line tools, there are still cases where some domain-specific logic needs to be run on the command line. Should this be your case, this article is a great place to start.

It’s a trap! React to Unix signals in Swift.

If you ever had to write a command-line tool that does some work that takes time you may be interested in how to react to Unix signals in it. Reacting to Unix signals is important as you may want to do some cleanup work before the system kills your process for example. Alejandro M. P. explores.

UI/UX

Making onscreen content available to Siri and Apple Intelligence

Last week we looked at the AppIntents framework in the scope of the announcement of Apple Intelligence. This week, Apple published a guide on integrating your app’s onscreen content with Siri and Apple Intelligence. It looks very likely that we’re going to do a lot of work with AppEntity, NSUserActivity and Transferable in the future.

How to use TipKit to create tooltips in SwiftUI

Sometimes you need to introduce a new feature to your users. Some apps have an onboarding flow where they guide you through the core features. No matter the case, using a native framework for this is what we prefer. This article guides you through the basics of adopting TipKit in your SwiftUI application.

Testing

Introducing Swift Testing. Basics.

The first article on Swift Testing that we have this week looks at the basics of writing tests with the help of the #expect and the #require macros. Where it was useful to us was in discovering the overloads of the #expect macro that allowed us to assert on the error types.

Introducing Swift Testing. Lifecycle.

We use XCTest’s setUp() and tearDown() to do some preparation work in our tests, and we wanted to keep this behavior when migrating to Swift Testing. This article explains how to do it, but it also looks at opting into serializing a certain test suite, as Swift Testing parallelizes it by default.

Introducing Swift Testing. Traits.

The last in the series of articles is focused on a new feature that does not have an analog in XCTest - traits. Traits are a way to annotate your tests, but what’s really cool is that they also allow you to enforce some behavior on your test suite.

Talk

TROOPERS24: Apple CarPlay - What’s Under the Hood

Ever wanted to take a look at what happens when you connect your iPhone with your car? Hannah Nöttgen does that for you in this talk at the TROOPERS24 IT Security conference.