Weekly Comment
Since creating this blog in 2020, I have accumulated nearly 200 articles over the years. Every year, I choose to take a break for a while (1-2 months). This not only gives me an opportunity to enrich myself deeply but also allows me to relax thoroughly, gathering strength for future challenges.
Starting next week, my blog will pause updates for a month. The weekly newsletter may or may not skip one or two issues. In mid-September, I will return with new articles, joining you all in welcoming Apple’s new systems and devices.
Originals
Nested Grid Layout Anomaly: Analysis Approach and Resolution Strategies for SwiftUI Layout Issues
After six iterations, SwiftUI is no longer a nascent framework. However, developers still occasionally encounter various peculiar issues stemming from bugs in the framework’s code during its use. This article will analyze a case of abnormal Grid layout, exploring the analytical approach and problem-solving strategies when encountering issues in everyday SwiftUI development.
Recent Selections
Task Isolation Inheritance and SwiftUI
Quinn ‘The Eskimo!’
With the widespread adoption of Swift 6 and the marking of the entire
View
protocol as@MainActor
in Xcode 16, developers frequently encounter related concurrency warnings and errors. In response to the increasing issues and feedback, Apple engineers have posted a series of posts on developer forums, sharing solutions to avoid repetitive answers to the same questions.
This article discusses a detail in Swift concurrency—Task Isolation Inheritance, particularly how it affects SwiftUI. The main focus is to explain why tasks inherit actor isolation properties from their surrounding code, how this inheritance can cause problems, and how to properly resolve these issues. Through a detailed analysis of this mechanism, the article aims to help developers better understand the complexities of concurrency programming, avoid common pitfalls, and thus write more robust and responsive SwiftUI applications.
My Favorite %$^#&!@ Swift Sites
Scott Anguish recommends a series of websites in this article that are instrumental in understanding some of the less commonly used but complex aspects of Swift programming language. These resources are particularly important for advancing Swift programming skills.
- NSDateFormatter.com: Provides various examples of date formatting, an interactive real-time format string platform, and a comprehensive summary of localized date handling.
- GoshDarnifCaseLetSyntax.com: This site focuses on explaining the
if case let
syntax, helping developers correctly understand and use this structure. - GoshDarnClosureSyntax.com: Shows the different ways to declare Swift closures.
- GoshDarnMultipletrailingClosureSyntax.com: Describes how to define multiple trailing closures. Note that this site does not support HTTPS connections.
- GoshDarnFormatStyle.com: Provides detailed insights on using
FormatStyle
, covering numeric, date, measurement, and list styles among others.
Customizing windows in SwiftUI
As SwiftUI becomes the leading framework for building applications across all Apple platforms, more and more platforms are supporting multi-window capabilities, and accordingly, the related APIs are also increasing. In this article, author Majid Jabrayilov provides a detailed guide on customizing windows on iPadOS, macOS, and visionOS, covering aspects such as default window size settings, window adjustability control, window placement adjustments, and window drag gesture handling.
Making Mistakes with Swift Concurrency
In this article, Matt Massicotte discusses common misconceptions and challenges in Swift concurrency programming. He covers a range of topics from the dangers of disabling warnings to the pressures of migrating to Swift 6, as well as the necessity of concurrency features and the complexities of using Sendable and Actor. Matt emphasizes that despite the challenges and errors that can be embarrassing and painful, they are an essential part of learning. The article encourages developers to maintain a positive and open attitude, embracing ongoing technical changes and challenges.
Releasing Swift Binaries with GitHub Actions
This article provides a detailed guide on how to use GitHub Actions to automate the building of Swift binaries for macOS and Linux and their release on the GitHub repository’s Release page. The article methodically explains each step and command to ensure readers understand and implement the entire automated building and release process.