Weekly Comment
On March 30th to 31st, 2024, I was fortunate to attend the Let’s VisionOS 2024 conference in Beijing. This grand event, being the world’s first large forum dedicated to VisionOS development, attracted distinguished guests and developers from all corners of the globe. Throughout the conference, speakers generously shared their professional techniques, valuable experiences, design philosophies, and insightful analyses of future trends in the VisionOS development field.
Due to the pandemic, community-led exchange activities in the Apple development sphere had been interrupted for a while. Thanks to the persistent efforts of the organizers, SwiftGG and XReality Zone, not only was this event a complete success, but it also set an excellent example for future offline gatherings within the Chinese Apple developer community.
The in-depth discussions held at this conference with developers from various regions and fields sparked new ideas, creative inspiration, and potential collaborations. I firmly believe this embodies the true value of offline events.
Looking forward, I hope that China’s developer community will host more events of this caliber. At the same time, I encourage every developer to cherish the opportunity to participate in global events, immerse themselves fully, and enjoy the joy and growth these events bring.
Originals
SwiftUI Views and @MainActor
An increasing number of developers are starting to enable strict concurrency checks in preparation for the arrival of Swift 6. Among the warnings and errors received, a portion relates to SwiftUI views, many of which stem from developers not correctly understanding or using @MainActor
. This article will discuss the meaning of @MainActor
, as well as tips and considerations for applying @MainActor
within SwiftUI views.
Recent Selections
Writing GNOME Apps with Swift
In recent years, the Swift community has actively promoted the application of the language across various platforms. However, due to the lack of suitable UI frameworks, it has been less utilized in building desktop applications on non-Apple platforms. Adwaita for Swift enables developers to construct user interfaces for the GNOME environment in a manner similar to SwiftUI. In this article, David Swift shows us the potential of developing Linux desktop applications using Adwaita for Swift, sharing a practical code example. The author also warmly invites readers to participate in all aspects of the Adwaita for Swift project, including app development, issue submission, documentation writing, and joining discussions, to collectively advance the project.
Dependency Injection for Modern Swift Applications Part II
In this article, Lucas van Dongen delves into the application of four main Dependency Injection (DI) strategies in modern Swift app development, including manual tree-based dependency management, EnvironmentObject
, the Factory pattern, and the Needle framework introduced by Uber. Considering key aspects such as compile-time safety, generational safety, scalability, usability, and testability, the author thoroughly compares the strengths and weaknesses of each method. The article suggests that the Factory pattern is a good choice for smaller projects, while larger projects might benefit more from adopting a framework like Needle to ensure high scalability and safety. For projects in their early stages, using Environment
or Singleton could serve as a flexible temporary solution, gradually transitioning to a more structured DI approach as the project evolves.
Although this article is a follow-up in a series, its content is designed to be read independently, offering readers a complete insight.
10 ½ Advanced App Store Optimization Secrets ASO Experts Will Never Share!
In this article, Ariel Michaeli shares a series of advanced App Store Optimization (ASO) strategies, including promoting in-app purchases, implementing in-app events, paying attention to the use of special characters, optimizing keyword layouts, accurately handling multi-word keyword combinations, and gaining a deep understanding of competitors. These strategies aim to significantly increase an app’s visibility on the App Store and Google Play. Michaeli notes that although many developers have mastered the basic skills of ASO, these advanced techniques offer opportunities for optimization beyond the basics, potentially making your app stand out significantly from the competition.
Iterating Over Web Socket Messages with Async / Await in Swift
Using for try await line in url.lines
, developers can retrieve data from a URL line by line, providing significant convenience. However, this method is not suitable for establishing WebSocket connections and listening for incoming messages. In this article, Donny Wals discusses how to construct a dedicated mechanism that allows developers to asynchronously iterate over WebSocket messages. Wals not only provides an efficient method for handling WebSocket messages but also paves new pathways for developers seeking to implement more complex communication patterns in Swift applications.
Our Apple Sports design critique
In this article, Sam Gold analyzes Apple’s newly launched app designed specifically for sports enthusiasts - Apple Sports. Starting from a design perspective, the article explores how the app ingeniously integrates and reimagines standard UI components, delves into the extensive use of gradients, the meticulous design of text, and the striking dynamic background effects. Through the discussion of these design details, Gold attempts to uncover the potential design trends of iOS 18.
Develop in Swift Tutorials
Apple has recently launched a new interactive tutorial - “Develop in Swift”. This tutorial covers the basics of SwiftUI, SwiftData, and VisionOS, providing beginners with a comprehensive introductory experience. Even experienced developers can find new learning opportunities and inspiration within these tutorials. Whether you are a programming novice or a seasoned developer looking to expand your skills, the “Develop in Swift” tutorials are well worth exploring.