NEW BOOK! SwiftUI Fundamentals: The essential guide to SwiftUI core concepts and APIs. Learn more ...NEW BOOK! SwiftUI Fundamentals:Master SwiftUI core concepts and APIs. Learn more...

Nil Coalescing Newsletter - January 2025

Hi there,

Welcome to the very first issue of this newsletter, I’m so excited to have you on board!

In this newsletter, I’ll be sharing updates from our small team at Nil Coalescing, cool projects we’ve worked on, interesting technical learnings, blog posts, and special discounts on my Swift and SwiftUI books, exclusively for newsletter subscribers. I aim to send this newsletter at the end of each month.

I’d like to start this issue with a brief introduction about myself and Nil Coalescing. My name is Natalia, and I’m a software developer based in New Zealand. I founded Nil Coalescing with my partner Matt in 2022. Before that, I worked at Apple as a frameworks engineer on the core SwiftUI team. I’m passionate about Swift and SwiftUI and love sharing everything I learn with the developer community through our blog and my books.

My partner Matt, the only other member of Nil Coalescing, is also an engineer who’s deeply passionate about Swift and Apple technologies. He loves building tools and infrastructure, he’s the one who built the platform I use to sell my books and the platform powering this very newsletter.

Photo of Natalia and Matt with their flat-coated retrievers Phoebe and Marley

Photo of Natalia and Matt with their flat-coated retrievers Phoebe and Marley

Together, as a team, we build apps, do consulting and freelance work for international clients, and also work on exciting projects for local organizations and businesses here in New Zealand. We live in a small town called Alexandra in Central Otago, where people often need tech help, and it’s rewarding to contribute to the local community.

Until the end of last year, I also worked part-time as a senior (and later lead) software engineer at Trade Me, a large New Zealand online marketplace for new and used items, jobs, and property. Starting in 2025, I’m focusing full-time on Nil Coalescing, with lots of exciting projects in the works - so stay tuned!


Projects

Exsto

Exsto is an unusual drawing app that generates randomized organic shapes with every stroke. It’s designed to spark creativity and help users create unique abstract artworks. We first released Exsto at the end of 2022 as an iPad-only app. In 2023, I took part in the Apple Entrepreneur Camp for female engineers and founders with Exsto. During the camp, our team received a lot of feedback and guidance from Apple designers and engineers on how to take Exsto to the next level.

Since then, we’ve released a few updates, added support for iPhone, and at the beginning of January, we finally launched the macOS version! We originally submitted it for review back in December, but the macOS review process took a bit longer than expected. We had to re-submit after being asked to clearly indicate in the descriptions and screenshots which features were part of the paid subscription. After making those adjustments, the app was accepted and officially released in early January.

Screenshots of Exsto on macOS

Screenshots of Exsto on macOS

EncodeDecode

I needed a convenient tool to quickly encode strings into a URL-encoded format, so I built a small macOS utility for the task. Then I realized it might be useful to others as well, so I decided to release it on the App Store. EncodeDecode runs in the menu bar, can be set to start at login, and provides system-wide URL-Encode and URL-Decode services accessible from any app on selected text.

There’s also a setting to customize how strings are encoded. By default, the app tries to parse the string as a URL and applies URL-encoding rules if successful. If not, it percent-encodes all characters except the allowed ones. For those who prefer always encoding reserved characters (like slashes, brackets, etc.), there’s an “Always encode reserved characters” option in the settings to make that behavior the default.

Implementing the system-wide services for encoding and decoding was fun. There isn’t much up-to-date documentation available, and the only guide I found was an older one with Objective-C examples. I figured it out in the end and wrote a blog post to help others who want to implement the same functionality in their apps.

Screenshots of EncodeDecode on macOS

Screenshots of EncodeDecode on macOS


Tech Learnings

Hyphenation in SwiftUI TextEditor

While working on EncodeDecode, I noticed some unexpected hyphenation behavior in SwiftUI's TextEditor view. By default, TextEditor will automatically add hyphens at line breaks when using standard fonts like body or caption. For example, in the code below, SwiftUI inserts hyphens as the text wraps:

struct ContentView: View {
    @State private var text = """
    ABCDEFGHIJKLMNOPQRSTUVWXYZ\
    abcdefghijklmnopqrstuvwxyz\
    0123456789-._~
    """
    
    var body: some View {
        TextEditor(text: $text)
            .font(.body)
            .frame(
                width: 300,
                height: 300
            )
    }
}

This behavior was quite frustrating in my app because the TextEditor is used for entering URLs or a list of characters to exclude from encoding, where hyphenation doesn’t make sense.

After some experimenting, I realized that using a font with an explicit size disables the automatic hyphenation. Here's the updated code that solves the issue:

struct ContentView: View {
    @State private var text = """
    ABCDEFGHIJKLMNOPQRSTUVWXYZ\
    abcdefghijklmnopqrstuvwxyz\
    0123456789-._~
    """
    
    var body: some View {
        TextEditor(text: $text)
            .font(
                .system(
                    size: 17
                )
            )
            .frame(
                width: 300,
                height: 300
            )
    }
}

Since macOS doesn’t support Dynamic Type, I didn’t need to implement any custom logic for scaling the font size. However, if you’re using explicit font sizes on platforms that do support Dynamic Type, like iOS, don’t forget to adjust your font size dynamically. This ensures that your app adapts to larger font sizes when users change their accessibility settings.


Blog

Provide macOS system-wide services from your app

Extend your app’s functionality to the entire macOS system by implementing services that users can access from the context menu or the Services menu in other apps.

Show a popover on iPhone in SwiftUI

Starting with iOS 16.4, we can use the presentationCompactAdaptation(_:) modifier to tell SwiftUI that we prefer popover presentation even in compact size classes.

Add launch at login setting to a macOS app

Register your macOS app as a login item using SMAppService.

Handle plurals in SwiftUI Text views with inflection

Display grammatically correct text effortlessly with Foundation's automatic grammar agreement, handling pluralization without extra logic.

Codable conformance for Swift enums

Learn how to add Codable conformance to Swift enums, including automatic synthesis, customizations, and fully manual implementations for complex cases.


Discounts

Every month, I share exclusive, limited-time offers on my books with email newsletter subscribers. Sign up so you don’t miss future newsletter issues and can take advantage of upcoming discounts!


Subscribe so you don’t miss future issues!

Invalid email address

Unexpected server error

Subscribed!

We take your privacy seriously and will never share your details with third parties.

You can unsubscribe anytime using the link in our emails.

Newsletter RSS feed