Snapp Mobile iOS Newsletter

Issue 14 • November 1, 2024

Hello,

What a week for the Mac, right? With new hardware across most of the lineup, it seems like there’s not much to complain about here.

In other news, iOS 18.1 rolled out this week with Apple Intelligence available outside of the EU. An agreement has been reached for the feature to launch in the EU with iOS 18.4 so it’s going to be a wait!

With that - enjoy what we have picked for you!

Swift

AnchoredRelativeFormatStyle: The Hidden Replacement for Date RelativeFormatStyle

Working with date/time can be tricky - ask anyone who had to do time zone conversions or time-based calculations. One of the most common things to do with dates is to present them in relation to an event (think of lines like “published 2 hours ago”). The new Foundation library comes with an AnchoredRelativeFormatStyle that is tailored for this, as this article explains.

Building a Custom Observer in Swift: A Deep Dive into Notifications with Async/Await

There are many ways to approach a problem, but sometimes borrowing ideas from what’s existing is the way. This article digs into how to implement a custom notification center that runs on modern Swift Concurrency while having some advantages over iOS’s NotificationCenter. It’s also a nice way to refresh your knowledge of the Observer design pattern.

UI/UX

Getting Started With App Intents

AppIntents are a way to share a piece of app-specific functionality with the OS. It allows your functionality to be used with voice commands, and it enables other apps to share their content with yours. With Apple Intelligence already available for most people, having some of your app logic running on AppIntents is a great way to ensure that the OS will remind users about your app and will promote it when applicable.

Creating an Interactive Widget with SwiftUI

If having an app intent alone does not justify it yet, this may change your mind. With iOS 17, Apple introduced a new type of widget - one that you can interact with. It’s built on top of the AppIntents framework, and it allows core pieces of your app to be used without having to open it. Being a good citizen matters even for apps.

Sparkling Shiny Things with Metal and SwiftUI

Metal has a reputation of a library that only hardcore programmers toy with. While some of the concepts require serious mathematical background, the basics are as approachable as any other Apple framework, should you be interested. Recently, we stumbled on a fascinating article on using Metal for implementing non-trivial button animations. Not only that, but it has the whole approach described in such detail that we think you’ll like it too.

Shared with You Implementation and Testing Explained

Shared with You is not a new feature, as it was introduced with iOS 16 a couple of years ago, but there are not that many apps that have adopted it. What it enables us is to highlight content shared in Messages inside our apps. This way, we can keep track of things without scrolling through long conversations.

Tools

GitHub Copilot for Xcode

With Xcode 16, Apple started shipping a predictive code completion model to help us write code faster. Some people are not happy with it, though, and now there’s an alternative. The first version of the GitHub Copilot plugin for Xcode is labeled as preview, but you can give it a shot by following the steps described in the repository.

Talk

Just Save a File, It’s Easy, Right?!

Mikaela Caron with an interesting talk at this year’s Swift Server Conference. File upload/download is among the very core features of what we call the web today. Ironically, it’s a feature that has many pitfalls and considerations to be made on the server-side. A talk with a twist.