Snapp Mobile iOS Newsletter

Issue 4 • August 23, 2024

Swift

An update about Swift Testing in the Swift 6 toolchain

SwiftTesting is becoming part of the Swift 6 toolchain! The announcement from the Swift core team also states that they’ll be creating the release/6.0 branch very shortly, in line with the other components of the Swift 6 release. Because Swift Testing will be in the Swift 6 toolchain soon, it won’t be necessary for package authors to include it as a package dependency anymore.

Introducing Oblivious HTTP support in Swift

Oblivious HTTP is a protocol to allow a client to make requests of a server without the server being able to identify the source of those requests. Conventional HTTP requests can reveal identifying information about the client such as the originating IP address, and can allow multiple requests from the same client to be identified as originating from the same node. An initial support for Oblivious HTTP in Swift NIO is now available on GitHub

SwiftData

SwiftData Background Tasks

When using CoreData you perform UI operations using a view context on the main queue. To avoid blocking the main queue you perform long running tasks like parsing and importing data using a private background queue context. So, how do you perform a SwiftData operation in the background?

UI

Mastering SwiftUI Animations: Phase Animations

With SwiftUI’s recent advances, animation has become incredibly accessible for iOS developers. One of the latest additions is the phase-based animation, which is designed to animate discrete steps within an animation. This article aims to explore phase-based animations, illustrating the process with custom examples.

Creating Advanced Animations with KeyframeAnimator in SwiftUI

In addition to the PhaseAnimator, SwiftUI introduced the KeyframeAnimator in iOS 17, allowing developers to create advanced animations using keyframes. In this tutorial, we will delve into the KeyframeAnimator and learn how to create a more intricate animation.

MainActor usage in Swift explained to dispatch to the main thread

MainActor is an attribute introduced in Swift 5.5 as a global actor providing an executor which performs its tasks on the main thread. When building apps, it’s essential to perform UI updating tasks on the main thread, which can sometimes be challenging when using several background threads. Using the @MainActor attribute will help ensure your UI is always updated on the main thread.

SwiftUI basic Shape operations

Most complex custom views can be made by composing many basic shapes together. In this article we will look at the basic operations that we can do with them. It may seem trivial, but knowing these basics will benefit you greatly. It’s also always great to discover something new while going through a refresher.

Utils

Cross-Platform Swift: View Paradigms

We are huge fans of what the guys at Point-Free are doing for the Swift Community. Recently they have started pushing the boundaries of what’s possible with Swift by looking outside of the Apple ecosystem. There’s now a free episode on their website where they do some explorations around the topic of cross-platform.