# 3 : Effective communication is a dialogue, not a monologue

Published on

Explore weekly Swift highlights with developers worldwide

Weekly Comment

Last week, Alexandre Colucci released his annual report analyzing the usage of Swift and SwiftUI in the latest version of iOS. The report’s findings were consistent with expectations, showing an increase in usage of both Swift and SwiftUI in iOS 17. Particularly exciting is the significant growth in the adoption of SwiftUI in Apple’s own applications.

As a loyal user of SwiftUI, I have been eagerly awaiting Apple’s deeper integration of this framework in more official applications. On one hand, this would allow Apple to gain a deeper understanding of the issues and shortcomings that arise when using SwiftUI in real-world applications, enabling faster feedback and optimization from the SwiftUI development team. On the other hand, it would accelerate the maturity and promotion of SwiftUI, making it more comprehensive, efficient, and stable.

Last October, the Ask Apple 2022 event received unanimous praise from developers. I have also been looking forward to Apple providing a similar communication platform this year. Perhaps Apple could make some adjustments to the format of the event, transitioning from a one-way Q&A to a more interactive two-way exchange. This way, while developers can ask Apple questions, Apple can also seek input from developers on certain issues or ideas, collectively promoting ecosystem development.

Originals

Mastering TipKit: Basics

fatbobman (东坡肘子)

TipKit is a framework newly introduced by Apple at WWDC 2023. It allows you to easily display tips in your applications. It can be used to introduce new features to users, help them discover hidden options, or showcase faster ways to accomplish tasks, among other scenarios. TipKit can run on various hardware environments and operating systems within the Apple ecosystem, including iPhone, iPad, Mac, Apple Watch, and Apple TV.

Developers can not only control the timing and frequency of tip display through settings such as rules and display frequency policies, but also obtain information about the status of tips and events associated with them through the API. While TipKit is primarily created for displaying tips, its functionality is not limited to that.

In this article, we will first learn and master the usage of TipKit.

I will explore the TipKit framework in two articles. In the next article, we will discuss more usage tips, considerations, implementation principles, and other extended topics on using TipKit in different scenarios.

Recent Selecions

Being a good citizen in the land of SwiftSyntax

Point-Free

SwiftSyntax is a Swift library that developers can use to parse, analyze, generate, and transform the syntax tree of Swift source code. As a large project, SwiftSyntax has a long compilation time, which significantly increases the build time of projects that use it.

Usually, this is not a big issue because not many client applications directly depend on the SwiftSyntax library. However, with the introduction of Swift 5.9 and macros, the situation has changed.

Since macros rely on SwiftSyntax, projects that use macros experience a time penalty during the build process. Additionally, there is an increased possibility of dependency issues due to the use of different major versions of SwiftSyntax in the project (SwiftSyntax versions are closely tied to Swift versions).

In this article, Brandon Williams and Stephen Celis discuss how a responsible developer should mitigate the impact of these issues in the era of increasing adoption of SwiftSyntax.

On the Swift Forums, there is a discussion about the widespread adoption of SwiftSyntax in macros.

Apple’s use of Swift and SwiftUI in iOS 17

Alexandre Colucci

Since 2016, Alexandre Colucci has been analyzing the usage of the Swift language in iOS 10. Starting from iOS 13, he has also added statistics on the usage of SwiftUI. In this article, he reveals the analysis results for this year. Overall, the proportion of Swift and SwiftUI applications continues to grow in iOS 17. Here are the highlights:

  • iOS 17 includes 6030 binary files, an increase of 627 compared to iOS 16.
  • The number of binary files using SwiftUI has reached 385, a growth of 70% compared to iOS 16.
  • The number of binary files using Swift has reached 1516, an increase of 50% compared to iOS 16.
  • There are now 14 apps based on the SwiftUI app lifecycle, compared to only 4 in iOS 16.
  • SwiftUI has seen a significant increase in usage within Apple’s own applications. The number of binary files exclusively using UIKit has decreased for the first time compared to the previous year.
  • Objective-C remains at the core of iOS, but the adoption rates of Swift and SwiftUI are rapidly increasing, while the proportions of Objective-C, C, and C++ continue to decline.

The original article contains more detailed analysis and richer charts.

On Launching your Indie App: Part 2

Jordan Morgan

In 2019, Jordan Morgan launched his app Spend Stack on the App Store. The product used a paid download model and included the option for pre-orders. Prior to the product release, he identified his target users, created promotional videos, websites, press releases, and actively contacted the media. He also promoted the app through online platforms. He shared the entire process in ”On Launching your Indie App: Part 1“.

Recently, Jordan Morgan released his new product Elite Hoops on the App Store. This time, he took a more low-key approach and focused less on media outreach, instead targeting his specific users. The business model for this product was changed to free with a subscription. Compared to the first launch, the work was more relaxed but yielded better results.

The author provides a detailed account of the app’s journey from pricing, target identification, pre-launch, promotion, and release. The article includes practical details and important considerations from the perspective of an indie developer, making it a valuable reference for developers planning to release an app.

Spring Animation from Scratch

Kit Langton

Spring animation achieves smooth transitions and elastic effects in views by simulating the stretching and compression actions of a spring. It is an excellent tool for achieving smooth, natural, and seamless animation effects.

At WWDC 2023, Apple introduced spring animation functionality for SwiftUI and made it the default animation. However, many people may not be proficient in setting parameters such as object mass, spring stiffness, and system damping.

Kit Langton will demonstrate the implementation details of spring animation through a video. The video is divided into two parts, starting with a brief introduction to physics, outlining the mathematical knowledge behind spring physics to prepare for the algorithms we are about to write. Then, Kit Langton will use Xcode to build our own spring animation framework. Through code, we will replicate the default spring animation in SwiftUI.

Running Stable Diffusion with Core ML on iOS smoothly

堤修一 / Shuichi Tsutsum

This is an article that explains how to optimize the performance of the Stable Diffusion Core ML model on mobile devices. When using Core ML Stable Diffusion for offline image generation on Apple devices, developers often face issues such as slow execution and high memory usage. In this article, the author introduces various optimization methods, including enabling the reduceMemory option, using smaller models, and mixed-bit quantization. The following achievements were ultimately realized:

Before optimization:

  • Model loading and initialization took 5 minutes
  • High memory usage
  • Generating one image took approximately 90 seconds

After optimization:

  • Model loading and initialization took 100 seconds
  • Memory usage reduced to approximately 850MB
  • Image generation time reduced to approximately 10 seconds
Get weekly handpicked updates on Swift and SwiftUI!

Buy me a if you found this article helpful