# 1 : New Beginning, New Weekly, Two Languages

Published on

Get weekly handpicked updates on Swift and SwiftUI!

New Beginning

A few months ago, the ”摸鱼周报” (Lazy Fish Weekly) officially came to an end after completing 100 issues. As an editor for the content recommendation section, I felt very relaxed and happy during the period that just ended, no longer needing to prepare articles every week. However, after some time, I realized that those articles I carefully selected, read, and recommended left a deep impression on me when I searched for technical clues from memory. Although I still read many articles and blogs every day after the publication ceased, the impression is not as profound as when I was an editor. Therefore, I have decided to create a new electronic newsletter where I can share excellent works and information while also gaining something from the process of collecting and organizing.

Although there are already many excellent electronic newsletters on the Internet, as a primarily Chinese-language blogger, I also have my own advantages. In Fatbobman’s Swift Weekly, in addition to providing subscribers with the latest news from my personal blog, I will also share content from other outstanding authors on topics such as Swift, SwiftUI, Core Data, SwiftData, etc., whether written in English, Chinese, or other languages.

Considering the main audience of my blog, this newsletter will be bilingual in Chinese and English.

From Fatbobman

Unveiling the Data Modeling Principles of SwiftData

@fatbobman

In the improvements made to SwiftData, the ability to declare data models purely in code has undoubtedly made a profound impression on Core Data developers. This article will delve into how SwiftData creates data models through code, the new Swift language features it utilizes, as well as the process and principles behind building PersistentModel.

Recent Selections

Using Core Data and Swift Data side by side

@Pol Piella Abadia

Pol Piella attempts to use Core Data and SwiftData together in a project, utilizing the same persistent data store. This article documents his actions and experiences. If you are planning to gradually migrate from Core Data to SwiftData or if you want to use SwiftData for specific use cases in your application, such as widgets, this article will be helpful.

At least at this stage, it is not easy to use both Core Data and SwiftData frameworks in the same project. Especially as the data model keeps changing, maintaining two different data models and codes will become more difficult. If you only need to use some Core Data features that are not supported in SwiftData, you can try using SwiftDataKit. If you are okay with using the approach of setting raw values (without creating NSManagedObject subclasses) to manipulate Core Data, you can also try the method described in the article Unveiling the Data Modeling Principles of SwiftData to create NSManagedObjectModel through SwiftData descriptions.

Thinking in SwiftUI (2023)

@Chris Eidhof and @Florian Kugler

In this book, Chris Eidhof and Florian Kugler will help readers develop a mental model of how SwiftUI works. They explain the most important concepts in detail and help you build a solid understanding of the fundamentals of SwiftUI.

As SwiftUI is a large framework, this book focuses on the concepts behind the framework that the authors consider crucial for understanding. It is not a reference for SwiftUI platform-specific APIs, but rather a guide to enhance your intuition about how SwiftUI works.

Some of my deeper understanding of SwiftUI comes from previous versions of this book. The book has undergone significant refactoring and updates its content to the latest API. This book is suitable for developers who already have some knowledge of SwiftUI and want to delve into the implementation principles of the framework.

解密 SwiftUI 背后的 AttributeGraph

Demystifying AttributeGraph Behind SwiftUI

@KyleSwifter

The author discovered a circular dependency error in the code while working on watchOS 10. This error was indicated by the AttributeGraph. By using a customized AttributeGraph analysis tool, they eventually found that the root cause was due to incorrect usage of the initialization method for NSAttributedString, as well as incorrect timing of AG fragment updates by system controls.

There are very few articles discussing AttributeGraph. Thanks to ByteDance and the author’s research on the underlying SwiftUI, we have the opportunity to explore the cause of the “cycle detected through attribute” issue in AttributeGraph. Kyle recently launched the OpenSwiftUI project, which aims to create an implementation that closely resembles the original SwiftUI API.

Advanced SwiftUI Animations – Part 6: CustomAnimation

@SwiftUILab

In this article, the author will discuss topics such as the Animation type and CustomAnimation protocol, handling new methods for Transactions, and new options for specifying animations. Additionally, the new PhaseAnimator and KeyframeAnimator views and methods will be discussed.

As the author of A Companion for SwiftUI, Javier has shown a strong interest in SwiftUI’s animation and layout implementation since its early release, and has showcased impressive research results through his blog. Each article has been extremely beneficial to me.

What Is Spatial Video On iPhone 15 Pro And Vision Pro

@XReality.Zone

For most consumers, the “spatial video” mentioned in Apple’s fall event may be just one of the many features that are not very eye-catching. The reason why it is not very eye-catching is probably because in addition to this segment of the show at the press conference, it is difficult for us to get a deeper perspective on what spatial video will look like.In this article, the author will discuss three matters related to “space”:

  • How to experience spatial photos in the simulator
  • What is spatial video/photo
  • What did Apple do

XRealityZone is a creator community focused on the XR field. They aim to help aspiring creators in the XR world to create and enhance their work through in-depth articles and tutorials, simple yet useful tools, and an active but respectful discussion group.

How async/await works internally in Swift

@Bruno Rocha

Async/await was introduced with iOS 15 in Swift. But have you ever wondered how async/await works internally? Or maybe why it looks and behaves the way it does, or even why it was introduced in the first place? In this article, Bruno Rocha will explore the Swift compiler to answer these questions and examine how async/await functions internally in Swift.

Author’s Disclaimer**:** I never worked at Apple and have nothing to do with the development of async/await. This is a result of my own research and reverse-engineering, so expect some of the information presented here to not be 100% accurate.

Weekly Swift & SwiftUI insights, delivered every Monday night. Join developers worldwide.
Easy unsubscribe, zero spam guaranteed