- Open Source Swift Project Updates
- Posts
- Open Source Updates for Swift Projects - Issue #11
Open Source Updates for Swift Projects - Issue #11
Time for the 11th issue of the bi-weekly newsletter “Open Source Updates for Swift Projects”
Do you notice some layout changes? That's because the newsletter migrated from Revue (which will shut down end of January 2023) to a new platform => beehiiv.com
Swift 5.7.2
In December, Xcode 14.2 was released and ships with Swift 5.7.2 !
To answer the question "What changes are included in Swift 5.7.2" you have to understand that the Swift language is managed as a collection of projects, each with its own repositories. The current list of projects includes:
The Swift compiler
The main Swift repository contains the source code for the Swift compiler and standard library, related components such as SourceKit (for IDE integration), the Swift regression test suite, and implementation-level documentation.
The Swift driver repository contains a new implementation of the Swift compiler’s “driver”, which aims to be a more extensible, maintainable, and robust drop-in replacement for the existing compiler driver.
The standard library bundled as part of the language
The LLDB debugger which includes the Swift REPL
The Swift package manager for distributing and building Swift source code
Xcode playground support to enable playgrounds in Xcode.
Some of the repositories have CHANGELOG files. Nevertheless, I found it interesting to glance at the commit messages by comparing the release tags, e.g.
No significant changes as Swift 5.7.2 is a patch release but if you were waiting for certain fixes you could easily check, with the method above, if the necessary changes found their way into Swift's latest release.
Understanding SwiftUI view lifecycles
Ole Begeman wrote an app called SwiftUI View Lifecycle. The app allows you to observe how different SwiftUI constructs and containers affect a view’s lifecycle, including the lifetime of its state and when onAppear gets called. The code for the app is on GitHub. It can be built for iOS and macOS.
Use modern SwiftUI Navigation APIs on older iOS versions
NavigationBackport is a dependency-free Swift package that uses the navigation APIs available in older SwiftUI versions (such as NavigationView and NavigationLink) to recreate the new NavigationStack APIs introduced in WWDC22 so that you can start targeting those APIs on older versions of iOS, tvOS, and watchOS.
I have to say that after a few weeks working with coordinators and SwiftUI making use of the NavigationBackport library (to have NavigationStack-like APIs for iOS 15), it is great!
Only bit of pain is with DeepLinking, but there is a workaround:
— Pol Piella (@polpielladev)
4:30 PM • Dec 20, 2022
RichText
RichTextKit is a Swift-based library that lets you edit rich text in UIKit, AppKit, and SwiftUI. It has a multi-platform RichTextView and a SwiftUI RichTextEditor and supports changing style (bold, italic, underline etc.), font, font sizes, colors, text alignment, etc. You can even drag in and paste images if you use a data format that allows it.
RichTextKit 0.4 is out, with new menus, macOS commands and focus keys. Next version will focus on performance improvements, so if you know how to best convert a big observed object to non-observed and make views observe/sync atomic changes, please DM.
github.com/danielsaidi/Ri…— Daniel Saidi (@danielsaidi)
11:07 AM • Dec 20, 2022
🚀 RichTextKit 0.3 is out, with strikethrough support, new toolbars, sidebars etc. plus support for keyboard shortcuts, localization and accessibility. Now, there are some remaining problems that I'd need help with. If you want to help out, let's do it! 😀
— Daniel Saidi (@danielsaidi)
10:50 AM • Dec 15, 2022
Happy Holidays!