Snapp Mobile iOS Newsletter

Issue 6 • September 6, 2024

Swift

Some keyword in Swift: Opaque types explained with code examples

The some keyword in Swift declares opaque types, and Swift 5.1 introduced it with support for opaque result types. Many engineers experience working with opaque types for the first time when writing a body of a SwiftUI view. Though, it’s often unclear what some keyword does and when to use them in other places. Antoine van der Lee discovers.

Migrating to Swift 6

Apple announced Swift 6 during WWDC 2024 as a major release of their programming language. After almost 4 years in development (from the originally announced roadmap) it’s finally here and there’s a lot things new about it to consider before migrating your apps. This guide by the Swift Language Group outlines the process.

macOS

Spotlight-like hotkey window

Daniel Arden with a useful article on how to create a system-wide Spotlight-like hotkey window for our SwiftUI app. In this article he explains how to create a window that would float on top of all other windows and can be triggered on any macOS space by pressing a user-customizable hotkey window, just like Spotlight.

UI

Create Custom SF Symbols in Sketch

Symbols (or icons) are an essential part of any app. It would be impossible to create software without them. Luckily, when developing for Apple platforms, we have the amazing SF Symbols at our disposal. And even although there are thousands of pre-made symbols we can choose from, there might be a time where the one you need just doesn’t exist yet. Hop on to discover how to do it.

Using TextRenderer to create highlighted text

TextRenderer is a new protocol introduced at WWDC 2024 which lets us enhance how text is rendered in SwiftUI. Here’s an article that shows you how to create a view that enables you to highlight certain parts of a given String. Previously this was primarily done using NSAttributedString, but with TextRenderer it is now possible to do the same in a pure SwiftUI way.

SwiftUI Field Guide

Here’s something for every iOS dev - an interactive guide to help you build an intuition of how the SwiftUI layout system works. Although such guides usually exist in the form of native apps, this is the first web-driven one that we saw.

XCode

How to use EditorConfig files in Xcode

As a developer for Apple platforms, you probably work on multiple projects with different coding styles and conventions and have to find yourself adjusting Xcode’s editor settings every time you switch between projects. Thankfully Xcode 16 adds support for EditorConfig files, which allows you to define Xcode editor settings in a programmatic way on a per-project basis, here’s how.

Xcode is an incredibly powerful integrated development environment (IDE) for macOS, designed for creating apps for all Apple platforms. However, as with any sophisticated tool, Xcode can accumulate a significant amount of cache over time.

This cache, while useful for speeding up the build process, can become massive, leading to a bloated system and potential performance issues. Understanding why and how to clean this cache is essential for maintaining an optimized development environment.