We are a group of people excited by the Swift language. We meet each Saturday morning to share and discuss Swift-related topics.
All people and all skill levels are welcome to join.
RSVP: https://www.meetup.com/A-Flock-of-Swifts/
-
Mihaela MJ: OpenAPI Logging middleware
https://github.com/mihaelamj/OpenAPILoggingMiddleware -
Mihaela MJ: Bearer token auth middleware
https://github.com/mihaelamj/BearerTokenAuthMiddleware -
Mihaela MJ: Swift OpenAPI “extreme packaging” example
https://github.com/mihaelamj/swift-openapi-extremepackaging-example
- Frank Lefebvre: CocoaConferences aggregator
https://cocoaconferences.com
Alex created a script to produce custom SF symbols. He is working on possibly open sourcing it.
Vector drawing: Figma, Sketch, Affinity Designer, Inkscape
- Ray Fix: Advanced Codable (“No‑Drama Codable”)
https://nothingtocommitworkingtreeclean.com/advanced_codable.html
- Bob DeLaurentis: (from web search) “Claude 3.5 Sonnet ~175B params; Claude 4 ~1.7T (unverified).”
- Josh Homann: “I run the 20B GPT‑OSS on ollama.”
- Mihaela MJ: OpenAI GPT‑OSS intro
https://openai.com/index/introducing-gpt-oss/
- Josh Homann: Swift diagnostics — nonisolated / non-sending by default
https://docs.swift.org/compiler/documentation/diagnostics/nonisolated-nonsending-by-default/ - Ray Fix: Swift Evolution: Module Selectors proposal
https://github.com/swiftlang/swift-evolution/blob/main/proposals/0491-module-selectors.md - Josh Homann: SpeechAnalyzer API
https://developer.apple.com/documentation/speech/speechanalyzer - Peter Wu: Mutex docs
https://developer.apple.com/documentation/synchronization/mutex
- Mihaela MJ: Point‑Free Clocks
https://github.com/pointfreeco/swift-clocks
- Ray Fix: UUIDExtras (v7 UUID package)
https://github.com/rayfix/UUIDExtras 👍
- Josh Homann: RxTvMaze
https://github.com/joshuajhomann/RxTvMaze/tree/master
-
Josh Homann: Profiling Foundation Models
https://artemnovichkov.com/blog/foundation-models-profiling-with-xcode-instruments -
Josh Homann: iOS 26 Foundation Model framework overview
https://antongubarenko.substack.com/p/ios-26-foundation-model-framework-f6d
.task {
do {
let instructions =
"""
You are a screen writer pitching ideas for a screenplay.
Your response should be a synopsis of the plot followed by a bulleted list
of major characters with a brief biography.
"""
let options = GenerationOptions(sampling: .greedy)
let session = LanguageModelSession(instructions: instructions)
session.prewarm()
let prompt = "Write a murder mystery set on a train"
let response = try await session.respond(to: prompt,
generating: ScreenPlaySynopsis.self, options: options)
print(response)
} catch {
print(error)
}
}- Josh Homann: Cracking the Coding Interview
https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/0984782850 - Josh Homann: neetcode YouTube channel
https://www.youtube.com/c/neetcode - Josh Homann: Leetcode
https://leetcode.com - Peter Wu: The Algorithm Design Manual
https://www.amazon.com/Algorithm-Design-Manual-Steven-Skiena/dp/1849967202 - Alex: Just for fun — Algorithms (big books)
https://mitpress.mit.edu/9780262046305/introduction-to-algorithms/
https://www.amazon.com/Computer-Programming-Volumes-1-4B-Boxed/dp/0137935102 - Tobias: Swift Collections Heap documentation
https://swiftpackageindex.com/apple/swift-collections/1.2.1/documentation/heapmodule/heap - Joe Mestrovich: Swift Algorithm Club (Kodeco)
https://github.com/kodecocodes/swift-algorithm-club - Josh Homann: Swift API Design Guidelines
https://www.swift.org/documentation/api-design-guidelines/ - Josh Homann: Advent of Code
https://adventofcode.com - Josh Homann: SymbolSearch project
https://github.com/joshuajhomann/SymbolSearch
@globalActor
actor MyActor {
static let shared = MyActor()
private init() { }
}- Josh Homann: SwiftLog
https://github.com/apple/swift-log - Josh Homann: Reactive ViewModels Simplified video
https://www.youtube.com/watch?v=uTLG_LgjWGA - Josh Homann: SwiftUI file exporter reference
https://developer.apple.com/documentation/swiftui/view/fileexporter(ispresented:document:contenttype:defaultfilename:oncompletion:) - Josh Homann: Claude for mobile demo
https://www.youtube.com/watch?v=NnYLzGMk8Tg&t=750s - Josh Homann: OpenAI GPT OSS 20B & 120B models
https://huggingface.co/openai/gpt-oss-120b - Peter Wu: Claude Code origin video
https://www.youtube.com/watch?v=Yf_1w00qIKc - Peter Wu: Claude Code best practices walk-through
https://www.youtube.com/watch?v=6eBSHbLKuN0&t=956s - Josh Homann: TechCrunch article on local AI models with iOS 26
https://techcrunch.com/2025/10/03/how-developers-are-using-apples-local-ai-models-with-ios-26/ - Peter Wu: objc.io Environment & Preference Updates episode
https://talk.objc.io/episodes/S01E409-environment-preference-updates
An example from Josh Homann.
import FoundationModels
let instructions =
"""
All recipes should be vegan. Start every answer with a bulleted list of ingredients followed by a description of the dish followed by a numbered list of instructions.
"""
let options = GenerationOptions(temperature: 5.0)
let session = LanguageModelSession(instructions: instructions)
let prompt = "create a recipe for Mapo Tofu"
let response = try await session.respond(to: prompt, options: options)
print(response.content)Allen used Claude to go through all of the pages documents that had a high level UML-like diagram of his design turn them into a movie.
There are things that you still cannot do with pure SwiftUI.
- https://developer.apple.com/documentation/uikit/uigesturerecognizerdelegate
- https://swiftwithmajid.com/2024/12/17/introducing-uigesturerecognizerrepresentable-protocol-in-swiftui/
Be careful about using SF symbol as images because they lose their original type-based semantics.
Consider using scaled metric: https://developer.apple.com/documentation/swiftui/scaledmetric
Text("Hello, World!")
.font(.title)
.padding()
.glassEffect(.regular.tint(.orange).interactive())Interesting impromptu discussion with Joe leading about how he uses app intents in some of his apps. Here are some resources:
- https://developer.apple.com/documentation/appintents/adopting-app-intents-to-support-system-experiences
- https://developer.apple.com/videos/play/wwdc2025/275
Shared by Rainer.
In depth coverage of how SwiftUI view updates.
Also from Josh:
Async algorithm share:
https://github.com/apple/swift-async-algorithms/blob/main/Evolution/0016-share.md
A bunch of shortcuts to produce things like screenshots that you can include in git commits.
An IDE for Shortcuts on macOS.
It is suprising just how slow NSImage is. If you are on the Mac, make sure you are using CGImage.
If you use the command line, this is how you can create code completion for zsh.
This is a deep dive on how rendering in iOS works.
Matt Mssicotte's take on when to use actors. (Which Josh doesn't seem to agree with but found it to be an interesting post.)
Carlyn talked about when it makes sense to generate your APIs using OpenAPI.
Some other options (resources):
Recreating Stateobject: https://fatbobman.com/en/posts/lazy-initialization-state-in-swiftui/
Ray F. did an exploration of the new Swift 6.2 strict memory enforcement.
We started by enabling checking in the package.
// swift-tools-version: 6.2And in the target:
.target(name: "uuid-exploration"),
swiftSettings: [.strictMemorySafety(), .treatAllWarnings(as: .error)])You can enable from the command line or as an argument in your Xcode project's build:
-strict-memory-safety
Then we fixed the warnings (errors) by adding unsafe to every place that required it.
unsafe withUnsafeMutableBytes(of: &random) { raw in
let result = unsafe SecRandomCopyBytes(kSecRandomDefault, 10, raw.baseAddress!)
precondition(result == errSecSuccess)
}Going back to the homework from Josh.
HTML/CSS are very good about separating semantics and style. SwiftUI, similarly can be decomposed into different parts.
As example consider this view which is all about content:
struct ContentView: View {
var body: some View {
List {
ForEach(0..<10) { i in
LabeledContent {
Text("Title")
.font(.body)
.foregroundStyle(.red)
Text("Subtitle")
Text("Subsubtitle")
Text("Subsubsubtitle")
} label: {
Label("hello", systemImage: "star.fill")
}
.labeledContentStyle(.verticalHierarchicalText)
}
}
}
}The style is applied with a custom modifier and can be defined like so:
struct HierarchicalLabeledContentStyle: LabeledContentStyle {
var orientation: Axis = .horizontal
var spacing: Double = .zero
enum Constant {
static let fontFromIndex: [Int: Font] = [ 1 : .body, 2: .caption2, 3 : .caption]
static let shapeStyleFromIndex: [Int: AnyShapeStyle] = [ 1 : AnyShapeStyle(.primary), 2: nyShapeStyle(.secondary), 3 : AnyShapeStyle(.tertiary)]
}
func makeBody(configuration: Configuration) -> some View {
let layout = switch orientation {
case .horizontal: AnyLayout(HStackLayout(spacing: spacing))
case .vertical: AnyLayout(VStackLayout(alignment: .leading, spacing: spacing))
}
HStack(spacing: 10) {
configuration.label
.alignmentGuide(.listRowSeparatorLeading) { $0[.trailing] + 10 }
layout {
var index = 0
ForEach(subviews: configuration.content) { subview in
subview.font(Constant.fontFromIndex[index] ?? .footnote)
.foregroundStyle(Constant.shapeStyleFromIndex[index] ?? AnyShapeStyle(.quaternary))
let _ = index += 1
}
}
}
}
}To allow for ergonomic auto-completing modifiers:
extension LabeledContentStyle where Self == HierarchicalLabeledContentStyle {
static var horizontal: Self {
Self(orientation: .horizontal)
}
static var verticalHierarchicalText: Self {
Self(orientation: .vertical)
}
static func verticalHierarchicalText(spacing: Double) -> Self {
Self(orientation: .vertical, spacing: spacing)
}
}- Ed Arenberg: Emoji Game Helper app (App Store link)
https://apps.apple.com/us/app/emoji-game-helper/id6749472749
- Josh Homann: iPhone URL Scheme reference
https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899-CH1-SW1 - Square link
https://squareup.com - Ed Arenberg: Mobile app design inspiration
https://dribbble.com/tags/mobile-app-design
- Josh Homann: Swift Interpreter article
https://www.bitrig.app/blog/swift-interpreter - https://github.com/SwiftyLua/SwiftyLua
Carlyn led a presentation on containers.
- Podman on macOS (shared twice)
https://www.whynotestflight.com/excuses/podman-how-do-i-get-and-edit-an-image-on-macos/ - HelloServer repo
https://github.com/carlynorama/HelloServer - HummingbirdExamples repo
https://github.com/carlynorama/HummingbirdExamples/
- Georgi Dagnall: New Docker tutorial (same channel)
https://www.youtube.com/watch?v=zFa9_K8BS8I - carlyn: YouTube reference (containers)
https://www.youtube.com/watch?v=SXwC9fSwct8
--
John Brewer informed us that Microsoft released the source code BASIC for the 6502.
It is about 8000 lines and compiles for multiple platforms, including the Apple II, Commodore PET and others.
Universal Unique IDs are an important part of application development are defined by RFC 4122 and is being updated in RFC 9562. See https://www.rfc-editor.org/rfc/rfc9562.html
The Foundation implementation is version 4 of RFC 4122 and contains 120 bits of randomness. Ray walked us through an extension that implements version 7 which uses Unix-based time so that UUIDs can be sorted in order.
The first thing we did was make a setter from a raw UInt128. The first implementation looks like this:
extension UUID {
@inlinable init(_ value: UInt128) {
let v: uuid_t =
(UInt8(value >> 120 & 0xff),
UInt8(value >> 112 & 0xff),
UInt8(value >> 104 & 0xff),
UInt8(value >> 96 & 0xff),
UInt8(value >> 88 & 0xff),
UInt8(value >> 80 & 0xff),
UInt8(value >> 72 & 0xff),
UInt8(value >> 64 & 0xff),
UInt8(value >> 56 & 0xff),
UInt8(value >> 48 & 0xff),
UInt8(value >> 40 & 0xff),
UInt8(value >> 32 & 0xff),
UInt8(value >> 24 & 0xff),
UInt8(value >> 16 & 0xff),
UInt8(value >> 8 & 0xff),
UInt8(value & 0xff))
self = UUID(uuid: v)
}
}Turns out that this is only valid for little endian platforms (which is most everything these days) but might fail on an embedded platform. Here is the final version:
import Foundation
extension UUID {
var version: Int {
Int((uuid.6 & 0xf0) >> 4)
}
enum Variant {
case ncs, rfc9562, guid, future
}
var variant: Variant {
switch (uuid.8 >> 4) & 0xf {
case 0x0 ... 0x7: .ncs
case 0x8 ... 0xb: .rfc9562
case 0xc ... 0xd: .guid
case 0xe ... 0xf: .future
}
}
init(_ value: UInt128) {
var bigEndian = value.bigEndian
let t = withUnsafeBytes(of: &bigEndian) { raw -> uuid_t in
raw.load(as: uuid_t.self)
}
self = UUID(uuid: t)
}
var value: UInt128 {
var source = uuid
var destination: UInt128 = 0
_ = withUnsafeBytes(of: &source) { src in
withUnsafeMutableBytes(of: &destination) { dst in
src.copyBytes(to: dst)
}
}
return Int(littleEndian: 42) == 42 ? destination.byteSwapped : destination
}
static func v7() -> UUID {
let timestamp = UInt128(Date().timeIntervalSince1970 * 1000)
var random = UInt128.zero
withUnsafeMutableBytes(of: &random) { raw in
let result = SecRandomCopyBytes(kSecRandomDefault, 10, raw.baseAddress!)
assert(result == 0)
}
var value = UInt128(0x7000_0000_000000000000)
value |= (timestamp & ((UInt128(1) << 48) - 1)) << 80
value |= (random & ((UInt128(1) << 76) - 1))
// Patch in the variant
value &= ~(UInt128(0b11) << 62) // clear the two bits
value |= (UInt128(0b10) << 62) // set to 10
return UUID(value)
}
var unixMilliseconds: UInt64? {
guard version == 7 else { return nil }
return UInt64((value >> 80) & ((UInt128(1) << 48) - 1))
}
var timestamp: Date? {
guard let unixMilliseconds else { return nil }
return Date(timeIntervalSince1970: TimeInterval(unixMilliseconds) / 1000.0)
}
}We also wrote some tests:
import Testing
import Foundation
@testable import uuid_exploration
@Suite struct UUIDTests {
@Test func version() {
let uuid = UUID()
#expect(uuid.version == 4)
#expect(uuid.timestamp == nil)
}
@Test func initialize() {
let x = UUID(1)
#expect(x.uuidString == "00000000-0000-0000-0000-000000000001")
#expect(x.value == 1)
let y = UUID(0x112233445566778899AABBCCDDEEFF00)
#expect(y.uuidString == "11223344-5566-7788-99AA-BBCCDDEEFF00")
#expect(y.value == 0x112233445566778899AABBCCDDEEFF00)
}
@Test func generateUUID7() {
let uuid = UUID.v7()
#expect(uuid.version == 7)
print(uuid.uuidString)
print(uuid.timestamp!)
}
}We also tested with this web service:
From Josh:
print(String(Int.random(in: 0..<Int.max), radix: 36).uppercased())Alternatively:
print(ObjectIdentifier(a).debugDescription)From Josh. Read up on this for next week:
This release introduces relaxed addition (that can use FMA instructions) for an order of magnitude performance gain.
https://github.com/apple/swift-numerics/releases/tag/1.1.0
- Joe: With iOS 26 I get Xcode console messages for “Attribute Graph: cycle detected through attribute” when using the new tab bar bottom accessory. Anyone else seeing these?
- Josh Homann: Article: Sendable / Non-Sending discussion
https://fatbobman.com/en/posts/sendable-sending-nonsending/
- Josh Homann: Example of global actor
@globalActor
actor MyActor {
static let shared = MyActor()
private init() { }
}- carlyn: I’ve started using containers! Will say more next week when I’m more confident.
https://www.whynotestflight.com/excuses/podman-how-do-i-get-and-edit-an-image-on-macos/
- Josh Homann: Subscriptions class
nonisolated final class Subscriptions {
private var disposables: [() -> Void] = []
deinit { disposables.forEach { $0() } }
static func += <Value> (lhs: Subscriptions, rhs: Task<Value, some Error>) {
lhs.disposables.append(rhs.cancel)
}
}- Josh Homann: Generic
assignfunction
func assign<each Value, Target: AnyObject>(
on target: Target,
to keyPaths: repeat ReferenceWritableKeyPath<Target, each Value>
) -> Task<Void, Never> where Element == (repeat each Value) {
subscribe(referencing: target) { target, values in
for (value, keyPath) in repeat (each values, each keyPaths) {
target[keyPath: keyPath] = value
}
}
}- Josh Homann: Custom Renderer for text blur effect
struct Renderer: TextRenderer {
var time: TimeInterval
func draw(layout: Text.Layout, in context: inout GraphicsContext) {
let glyphs = layout.lazy.flatMap(\.self).flatMap(\.self)
let currentTime = sin(time)
for (offset, glyph) in glyphs.enumerated() {
var context = context
let blur = abs(Double(offset) * currentTime)
context.addFilter(.blur(radius: blur))
context.translateBy(x: 0, y: Double(offset) * 5 * currentTime)
context.draw(glyph)
}
}
}- Josh Homann: Example
ContentViewusingTimelineView
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
TimelineView(.animation) { context in
Text("Hello, world!")
.font(.largeTitle)
.textRenderer(Renderer(time: context.date.timeIntervalSince1970))
}
}
.padding()
}
}It is wise to not do encryption and payment systems yourself.
- Josh Homann: Stripe https://stripe.com/
- *Ray FASWebAuthenticationSession OAuth
- Ray Fix: Credit card input UI inspirations https://dribbble.com/tags/credit-card-input
- Josh Homann: Auth0
https://auth0.com
- carlyn: OnePassword, BitWarden, LastPass … used them all but I still like the built-in password manager
- carlyn: Bitwarden is freemium open-source
- Josh Homann: Apple recovery contact guide
https://support.apple.com/en-us/102608 - Bob DeLaurentis: Diceware password method
https://en.wikipedia.org/wiki/Diceware - Josh Homann: CryptoKit docs
https://developer.apple.com/documentation/cryptokit/ - Bob DeLaurentis: Secure features in Notes app
https://support.apple.com/guide/security/secure-features-in-the-notes-app-sec1782bcab1/web
- Josh Homann: Scene Reconstruction Provider
https://developer.apple.com/documentation/ARKit/SceneReconstructionProvider
Using observed to replace combine.
- Josh Homann: Shared
Observation.Observableextension snippet:
extension Observation.Observable where Self: AnyObject {
func values<Value: Sendable>(of keyPath: KeyPath<Self, Value>) -> some AsyncSequence<Value, Never> {
Observations.untilFinished { [weak self] in
self.map { .next($0[keyPath: keyPath]) } ?? .finish
}
}
func newValues<Value: Sendable>(of keyPath: KeyPath<Self, Value>) -> some AsyncSequence<Value, Never> {
values(of: keyPath).dropFirst()
}
}- Josh Homann: Example
@ObservablePerson class:
@Observable
@MainActor
final class Person: Sendable {
var name = "Joshua"
var age = 25
init() {
let a = newValues(of: \.name)
Task {
try await Task.sleep(for: .seconds(1))
name = "Mark"
}
Task {
for await name in a {
print(name)
}
}
}
}- https://github.com/carlynorama/HummingbirdExamples/tree/main/04_front_end_work/welomeToTheCircus/Sources/welcomeToTheCircus/HTMLMakers
- https://github.com/carlynorama/HummingbirdExamples/
- https://github.com/carlynorama/SimplerServer
If you need a static site generator:
https://github.com/twostraws/Ignite
- Josh Homann: nshipster article https://nshipster.com/javascriptcore/
A live example:
import JavaScriptCore
let context = JSContext()
let squareScript = """
var a = 1;
function square(number) {
return number * number;
}
"""
context?.evaluateScript(squareScript)
let square = context?.objectForKeyedSubscript("square")
print(square?.call(withArguments: [2]).toDouble())- WKWebView reference
https://developer.apple.com/documentation/webkit/wkwebview/evaluatejavascript(_:completionhandler:) - SwiftUI WebView reference
https://developer.apple.com/documentation/webkit/webpage/calljavascript(_:arguments:in:contentworld:)
- Alex: Apple Protobuf generator https://github.com/apple/swift-protobuf
- Chitaranjan sahu: WWDC 2023 video https://developer.apple.com/videos/play/wwdc2023/10171/
- John Brewer: External Javascript in hybrid apps (StackOverflow links)
https://stackoverflow.com/questions/43517892/apple-store-guidelines-external-javascript-files-in-hybrid-mobile-application
https://stackoverflow.com/questions/43503259/convert-server-generated-site-to-phonegap-cordova-app/43504441#43504441
- Josh Homann: SwiftUI TabView for page controller snippet:
TabView {
// ... views ...
}
.tabViewStyle(.page(indexDisplayMode: .always))- Chitaranjan sahu: SwiftLint repo
https://github.com/realm/SwiftLint
- Ray Fix: Inline Array Sugar proposal accepted https://github.com/swiftlang/swift-evolution/blob/main/proposals/0483-inline-array-sugar.md
- Peter Wu: I highly recommend Claude code — the $20 is worth it
- Alex: https://ollama.com
- Chitaranjan sahu: https://lmstudio.ai/ (Download and run models on your computer)
- Frank Lefebvre: There’s MLX too, optimized for Apple Silicon
https://github.com/ml-explore/mlx - Josh Homann: Swift Composable Architecture examples
https://github.com/pointfreeco/swift-composable-architecture?tab=readme-ov-file#examples
- Josh Homann: News link
https://www.benzinga.com/markets/tech/25/08/46949685/zuck-poaching-effect-pushes-openai-to-announce-1-5-million-bonus-for-all-employees-even-new-hires-says-tech-entrepreneur
- Josh Homann: Minimum touch targets by platform
https://developer.apple.com/design/human-interface-guidelines/accessibility
- Peter Wu: Category Theory for Programmers
https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
- Josh Homann: SwiftUI Backports
https://github.com/shaps80/SwiftUIBackports - Josh Homann: Silent memory leak fix
https://medium.com/@egzonpllana/how-i-stopped-a-silent-memory-leak-in-my-ios-app-282aef170df5 - Peter Wu: Past project demonstrated RAII https://github.com/aflockofswifts/meetings/tree/main/2024#20240406
- Frank Lefebvre: About available memory: on iOS (and all other platforms except macOS) you can use
os_proc_available_memory()
- Peter Wu: AsyncSequence assign example
https://github.com/sideeffect-io/AsyncExtensions/blob/main/Sources/Operators/AsyncSequence+Assign.swift
- Josh Homann: Assembly for Swift developers
https://arturgruchala.com/assembler-for-swift-developers/?utm_source=substack&utm_medium=email - carlyn: Helpful tool
https://cpulator.01xz.net - carlyn: Video resource
https://www.youtube.com/watch?v=in-UY_EyI14&list=PL2EF13wm-hWAlQe87UB2HV0SVhBXFpXbn
https://github.com/swiftlang/swift-evolution/blob/main/proposals/0475-observed.md
import Swift
import Observation
@Observable
final class Person: Sendable {
var name = "John"
var age = 30
init(name: String = "John", age: Int = 30) {
self.name = name
self.age = age
}
}
extension Observation.Observable where Self: Sendable & AnyObject {
func changes<Value: Sendable>(in transform: @escaping @Sendable (Self) -> Value) -> some AsyncSequence<Value, Never> {
Observations.untilFinished { [weak self] in
if let self {
return .next(transform(self))
} else {
return .finish
}
}
}
}
let p = Person()
let names = p.changes { $0.name }
Task {
for await name in names {
print(name)
}
}
Task {
try await Task.sleep(for: .seconds(1))
p.name = "Jane"
try await Task.sleep(nanoseconds: 0)
p.name = "Jim"
}Sharing async streams begins a new round of development.
-
Swift Async Algorithms Proposal: Broadcast
https://forums.swift.org/t/swift-async-algorithms-proposal-broadcast-previously-shared/61210 — via Robert G. -
Kickoff of a New Season of Development for AsyncAlgorithms
https://forums.swift.org/t/kickoff-of-a-new-season-of-development-for-asyncalgorithms-share/81447 — via Ray F. -
Open Pull Requests for Swift Async Algorithms
https://github.com/apple/swift-async-algorithms/pulls — via Josh H.
-
Perception 2.0 (Point-Free blog)
https://www.pointfree.co/blog/posts/180-perception-2-0-an-updated-back-port-of-swift-s-observation-framework — via Ray F. -
PerceptionCheckingTests.swift from Point-Free
https://github.com/pointfreeco/swift-perception/blob/main/Tests/PerceptionTests/PerceptionCheckingTests.swift — via Peter W.
- SE-0240: Ordered Collection Diffing
https://github.com/swiftlang/swift-evolution/blob/main/proposals/0240-ordered-collection-diffing.md — via Josh H.
From Alex:
KeyframeTrack(\.x) {
MoveKeyframe(0)
LinearKeyframe(0, duration: appearDuration)
let keyframes = spiralKeyframes(cos, targetAngle: a, targetRadius: r, duration: flyDuration)
KeyframeTrackContentBuilder.buildArray(keyframes)
}Comment:
"This line allows me to use runtime-generated array of keyframes inside track content builder:
KeyframeTrackContentBuilder.buildArray()"
-
Landmarks: Building an App with Liquid Glass
https://developer.apple.com/documentation/swiftui/landmarks-building-an-app-with-liquid-glass — via Josh H. -
Chris Eidhof: How SwiftUI’s Rendering Works
https://youtu.be/dCSf9nR6SOQ?si=G6_9HW5sPjEPGMSb — via Chitaranjan S.
-
TrackWeight app on GitHub
https://github.com/KrishKrosh/TrackWeight — via Chitaranjan S. -
Core Motion CMotionManager Docs
https://developer.apple.com/documentation/coremotion/cmmotionmanager — via Josh H. -
Redline GitHub Repo
https://github.com/robb/Redline — via Josh H.
- Default Actor Isolation (Fatbobman)
https://fatbobman.com/en/posts/default-actor-isolation/ — via Josh H.
- https://github.com/pointfreeco/swift-composable-architecture – John B.
- https://www.youtube.com/watch?v=efGCznIDVb4 – Bob D.
- https://www.youtube.com/watch?v=XWZmgbylTpc – Bob D.
- https://ios-developers.io – Josh H.
- https://discord.gg/dVbEFjbU – carlyn
- https://www.meetup.com/Learn-Swift-Boston/ – Peter W.
- https://www.swiftbysundell.com/articles/let-vs-var-for-swift-struct-properties/ – Peter W.
- https://docs.swift.org/swift-book/documentation/the-swift-programming-language/declarations/#In-Out-Parameters - Peter W.
- https://developer.apple.com/documentation/realitykit/realityview/init(make:update:)-666xr – John B.
- https://github.com/swiftlang/swift-evolution/blob/main/visions/embedded-swift.md – John B.
- https://developer.apple.com/videos/play/wwdc2023/10172/ – John B.
- https://github.com/carlynorama/SoManyWaysToInclude – carlyn
- https://github.com/carlynorama/CxxInteropLibrary – carlyn
- https://github.com/carlynorama/CppInteropSimplestXCode – carlyn
- https://www.swift.org/documentation/cxx-interop/) – carlyn
- https://github.com/carlynorama/another-swift-cmake-examples – carlyn
- https://bazel.build – carlyn
- https://crascit.com/professional-cmake/ – carlyn
- https://www.youtube.com/watch?v=m0DwB4OvDXk – carlyn
- https://github.com/carlynorama/swift-pico-w-hello/blob/e180cf9b99b042ef16589ed881d48489124ea731/XX-BadgeFirmware/HAL/LanguageSupport.swift#L12 – carlyn
- https://github.com/carlynorama/swift-pico-w-hello/tree/main/08-StrippedDownBlink – carlyn
- https://github.com/Cocoanetics/SwiftMCP – Chitaranjan S.
- https://www.youtube.com/watch?v=ANOpQiLG7Q0 – Chitaranjan S.
- https://www.youtube.com/watch?v=qjHf_S_PxSw – Chitaranjan S.
- https://crascit.com/professional-cmake/ – carlyn
- https://www.youtube.com/watch?v=m0DwB4OvDXk – carlyn
- https://developer.apple.com/videos/play/wwdc2025/268 – John B.
- https://developer.apple.com/videos/play/wwdc2025/270 – John B.
- https://developer.apple.com/videos/play/wwdc2024/10151 – carlyn
- https://medium.com/@rishixcode/animated-mesh-gradient-in-swiftui-e1c2e11ed6bf – carlyn
struct MeshGradientView: View {
@State var isAnimating = false
var body: some View {
MeshGradient(width: 3, height: 3, points: [
[0.0, 0.0], [0.5, 0.0], [1.0, 0.0],
[0.0, 0.5], [isAnimating ? 0.1 : 0.8, 0.5], [1.0, isAnimating ? 0.5 : 1],
[0.0, 1.0], [0.5, 1.0], [1.0, 1.0]
], colors: [
.purple, .indigo, .purple,
isAnimating ? .mint : .purple, .blue, .blue,
.purple, .indigo, .purple
])
.edgesIgnoringSafeArea(.all)
.onAppear() {
withAnimation(.easeInOut(duration: 3.0).repeatForever(autoreverses: true)) {
isAnimating.toggle()
}
}
}
}From Joe:
Found what I needed to get my UIKit (storyboard and UIViewControllerRepresentables) to work with the transparent tab bar in iOS 18 and iOS 26
.ignoresSafeArea(.all, edges: .bottom)
.toolbarBackgroundVisibility(.hidden, for: .tabBar)- https://kiro.dev/blog/introducing-kiro/ – Robert G.
- https://www.wheresyoured.at/the-haters-gui/ – John B.
- https://getunblocked.com – Mihaela MJ / Peter W.
The new Observations API is still not available in the current Xcode beta 3.
Josh talked about a solution for the new apple emoji game. The correspondance problem between emoji images and word solutions probably requires an LLM.
You can solve the word problem independently. An old game that Josh used a trie to solve the Boggle game.
A more generalized type of trie useful for the emoji game is a "compressed suffix trie" which can quickly match substrings.
Peter investigating the subtleties of TaskGroup and cancellation.
“Since a TaskGroup is a structured concurrency primitive, cancellation is automatically propagated through all of its child-tasks (and their child tasks).”
These blog posts go into quite a bit of depth about how things work.
Another solution is to create a variant of Text that never truncates and use it in combination with ViewThatFits.
From Chitaranjan:
Frank Lefebvre is teaching a workshop on embedded Swift. Here is a link to some of the materials he has used.
Carlyn suggests starting with something simpler than Swift. (i.e. Vendor environments tends to be highly streamlined.)
Also, for board design:
A cool clock design with 48 stepper motors. Alex is experimenting building something like it and showed:
Another motor based art project from Carlyn
Here are some general resources:
- https://danielsaidi.com/blog/2022/04/27/building-multi-platform-documentation-with-docc
- https://forums.swift.org/t/customizing-the-look-and-feel-of-swift-docc-render/58858
- https://www.youtube.com/watch?v=8KoIXbm0nv4
(Sounds like Carlyn is hoping to inspect the AST and build a custom DOCC backend. The most relevant one supplied by Bob.)
Carlyn's docc notes:
YYUR, YYUB, ICUR YY4ME
There is a new puzzle game that Apple released in the news App. It requires you to drag emoji combination.
The idea is that instead of a sequential context window, it uses a diffusion model to come up with the global structure of the program.
We made an experimental Inventory app on macOS 26 and Xcode 26.
Some thoughts:
- It put together mostly working code.
- It made some unfortunate design decisions (user defaults storage, monolithic file to store everything)
- We were able to correct the problems though it did put some things in the wrong file and forgot to inject all of the dependencies.
There is a new beta available for 26.
For new toolchains there is an excellent tool called Swiftly:
Allen had a question about animating sticks and spheres using SceneKit. The spheres are animating smoothly while the sticks attached to the spheres would jump into place at the end. The question was how to make it smooth. The issue was that he was rendering the sticks using billboards. The consensus recommendation was to use simple geometry (e.g. hexagonal rod) to render the sticks and let the system handle it for you.
Aside: SceneKit has been deprecated in favor of Reality kit.
Josh notes that in many of his projects he defines a result builders to declaratively define arrays.
Here is the result builder:
Here is how you do it for array:
@resultBuilder
struct ArrayBuilder<Element> {
typealias Expression = Element
typealias Component = Array<Element>
static func buildBlock(_ components: Component...) -> Component {
buildArray(components)
}
static func buildExpression(_ expression: Expression) -> Component {
[expression]
}
static func buildExpression(_ expression: Expression?) -> Component {
expression.map { [$0] } ?? []
}
static func buildOptional(_ component: Component?) -> Component {
component ?? []
}
static func buildEither(first component: Component) -> Component {
component
}
static func buildEither(second component: Component) -> Component {
component
}
static func buildArray(_ components: [Component]) -> Component {
components.flatMap { $0 }
}
static func buildLimitedAvailability(_ component: Component) -> Component {
component
}
}An extension improves the ergonomics.
extension Array {
static func build(@ArrayBuilder<Element> _ make: () -> Self) -> Self {
make()
}
}You can use it like this:
var b = true
var c: Int? = nil
let a = Array<Int>.build {
1
2
c
if b {
3
}
if #available(iOS 26.0, *) {
4
}
}Another compelling use case for result builders is declarative tests:
A functional library for swift:
- https://www.semanticscholar.org/paper/A-System-for-Efficient-and-Flexible-One-Way-in-C%2B%2B-Hudson/9609985dbef43633f4deb88c949a9776e0cd766b
- https://talk.objc.io/collections/swiftui-layout-explained
If you have background in CS, it is hard to beat Paul Hegerty's class even thought it is a little old.
A starting point for a lot of people:
There are degrees you can get through coursera and udacity but consensus says a github account with the portfolio project is great. Meta has a certificate as well.
- https://www.coursera.org/degrees
- https://www.udacity.com
- https://www.coursera.org/professional-certificates/meta-ios-developer
- Cursor ai: https://www.youtube.com/watch?v=oOylEw3tPQ8
- Reverse-Engineering Xcode's Coding Intelligence prompt https://peterfriese.dev/blog/2025/reveng-xcode-coding-intelligence/
- https://github.com/pointfreeco/sharing-grdb
- https://www.pointfree.co/blog/posts/168-sharinggrdb-a-swiftdata-alternative
- https://www.pointfree.co/episodes/ep313-point-free-live-sharinggrdb
All of the free episodes for pointfree are here:
- https://www.createwithswift.com/exploring-a-new-visual-language-liquid-glass/?utm_source=substack&utm_medium=email
- https://developer.apple.com/design/human-interface-guidelines/
- https://www.donnywals.com/exploring-tab-bars-on-ios-26-with-liquid-glass/?utm_source=substack&utm_medium=email
- https://nilcoalescing.com/blog/StretchyHeaderInSwiftUI/?utm_source=substack&utm_medium=email
- https://steipete.me/posts/2025/automatic-observation-tracking-uikit-appkit
- https://christianselig.com/2025/05/godot-ios-interop/
- https://onevcat.com/2025/06/foundation-models/
- https://azamsharp.com/2025/06/18/the-ultimate-guide-to-the-foundation-models-framework.html
Ray is embarking on a Embedded Swift hobby project to build a one button remote that toggles the mute on his Sony TV. He is using an ESP32C6 dev kit from espressif.
There is some good documentation for Embedded Swift:
Swiftly is a good tool for managing toolchains:
A previous exploration by Carlyn:
Software 3.0 by Andrej Karpathy
More talks:
Also,
- https://www.massicotte.org/extensionkit-intro?utm_source=substack&utm_medium=email
- https://mastodon.social/@mattiem/114665149298651073
Josh took us through many of the SwiftUI changes presented by Paul Hudson.
With the new Liquid Glass theme, you might want to checkout the HIG again.
Josh tells Ed to watch this!
Also, squircles...
We discussed some other meetups:
- https://links.iosdevhappyhour.com
- https://lu.ma/core-coffee We discussed solving the Valid Palindrome problem and how the particulars of Swift's String implementation make this different than the solutions in other languages. We discussed comparing normalized strings:
let chars: [Character] = ["a", "ä"]
extension Character {
func isSemanticallyEquivalent(to other: Character) -> Bool {
// String(self).compare(String(other), options: [.diacriticInsensitive, .caseInsensitive, .widthInsensitive], locale: .current) == .orderedSame
String(self).folding(options: [.diacriticInsensitive, .caseInsensitive, .widthInsensitive], locale: .current) == String(other).folding(options: [.diacriticInsensitive, .caseInsensitive, .widthInsensitive], locale: .current)
}
}
print(chars[0].lowercased() == chars[1].lowercased())
print(chars[0].isSemanticallyEquivalent(to: chars[1]))
```swift
Then how to solve the problem: First the indexing solution which shows how RandomAccessCollection works. YUou should no use this solution in any language since index math is unsafe:
```swift
extension RandomAccessCollection where Element == Character {
var isPalindrome: Bool {
let backwards = reversed()
var front = indices.first
var back = backwards.indices.first
while let unwrappedFront = front, let unwrappedBack = back {
front = self[unwrappedFront...].firstIndex(where: \.isLetter)
back = backwards[unwrappedBack...].firstIndex(where:\.isLetter)
guard let unwrappedFront = front, let unwrappedBack = back else { return true }
guard self[unwrappedFront].isSemanticallyEquivalent(to: backwards[unwrappedBack]) else {
return false
}
front = front.map { self.index(after: $0) }
back = back.map { backwards.index(after: $0)}
}
return true
}
}Next the iterator solution:
extension BidirectionalCollection where Element == Character {
var isPalindrome2: Bool {
var frontIterator = makeIterator()
var backIterator = reversed().makeIterator()
var matchCount = 0
let length = count / 2
while let front = frontIterator.next(where: \.isLetter), let back = backIterator.next(where: \.isLetter), matchCount < length {
guard front.isSemanticallyEquivalent(to: back) else {
return false
}
matchCount += 1
}
return true
}
}
private extension IteratorProtocol where Element == Character {
mutating func next(where predicate: (Character) -> Bool) -> Character? {
while let next = next(){
if predicate(next){
return next
}
}
return nil
}
}And finally the functional solution:
extension String {
var isPalindrome3: Bool {
zip(
lazy.compactMap { $0.isLetter ? $0 : nil },
reversed().lazy.compactMap { $0.isLetter ? $0 : nil }
).prefix(count/2).allSatisfy { $0.isSemanticallyEquivalent(to: $1) }
}
}Discussion about testing, specifically about testing Combine.
- https://developer.apple.com/documentation/combine/processing-published-elements-with-subscribers
- https://github.com/FlineDev/ErrorKit
Carlyn gave us a Swift testing demo and it is awesome. We also went over how to get code coverage numbers in Xcode.
Josh talked about how many
10:33:45 From Peter Wu to Everyone: For larger code bases codecov is nice that you can see the lines not covered in a PR https://about.codecov.io
A previous project from Josh (before concurrency) forming a nice example about how to get the buisness logic out of your tests.
- https://openai.com/index/introducing-codex/
- https://repoprompt.com
- https://pre-commit.com/
- https://aider.chat
11:05:51 From carlyn to Everyone: https://www.cookiecutter.io
From Bob: This is newly released from Marcin Krzyzanowski: a third-party “Swift Playground”. https://notepadexe.com/ Looks like fun.
- General longing for the simple early days and the wonders of getting new stuff at WWDC.
- Apple behind in server tech? Swift could be a great solution.
- Widgets are not in a great state. Hoping for improvements at WWDC. (Problems around multiprocessing and controlling when they wake up.)
- https://forums.swift.org/t/pitch-progress-reporting-in-swift-concurrency/78112
- https://forums.swift.org/t/review-sf-0023-progress-reporting-in-swift-concurrency/79474
- https://developer.apple.com/videos/play/wwdc2023/10171/
- https://www.swift.org/blog/introducing-swift-openapi-generator/
A demo of using the dependency management system from pointfree
Alex showed us a dependency injection tool he created.
- https://en.wikipedia.org/wiki/PragmataPro
- https://github.com/fabrizioschiavi/pragmatapro
- https://github.com/shytikov/pragmasevka
Looking for examples.
Example (non-production, proof of concept): https://github.com/franklefebvre/DistributedActors-FrenchKit
available length = ((container length - safe area) - (spacing x (count - 1))
column length = available length / count
view length = (column length x span) + ((span - 1) x spacing)
Here is the code we experimented with:
struct ContentView: View {
var body: some View {
ScrollView(.horizontal) {
LazyHStack(spacing: 100) {
ForEach(0..<20) { item in
Rectangle()
.fill([Color.red, .green, .blue][item % 3])
// .aspectRatio(3.0 / 2.0, contentMode: .fit)
.frame(height: 100)
// .overlay(Color.yellow.opacity(0.5))
.containerRelativeFrame(
.horizontal, count: 3, span: 1, spacing: 100)
// .overlay(Color.blue.opacity(0.5))
}
}
}
// .safeAreaPadding(.horizontal, 20.0)
}
}
#Preview {
ContentView()
}A cool low level exploration:
A mocking library announced at Deep Dish from Peter's company fetch-rewards!
- https://swiftpackageindex.com/fetch-rewards/swift-mocking
- https://github.com/fetch-rewards/swift-mocking
Carlyn's experiments on the subject.
https://swiftpackageindex.com/fetch-rewards/swift-mocking
Peter took us on a blog post tour:
Exploring the sounds that are available:
import AVFoundation
var greeting = "Hello, playground"
let systemSoundIDs: [SystemSoundID] = Array(1000...4000).map { SystemSoundID($0)}
for id in systemSoundIDs {
// AudioServicesPlaySystemSoundWithCompletion(id) {
// print(id)
// return
// }
AudioServicesPlaySystemSound(id)
AudioServicesPropertyID(systemSoundIDs[0])
}
Tutorial for creating system sounds (with a funny ending):
Haptics might be a useful semantic way to get some sounds:
"321" - Three copies of your data, two formats, one offsite.
"Just use Backblaze."
Paul Hudson's static website builder, Ignite, continues to be awesome to use. Mihaela
Talked about how to use your own custom domain.
Useful for debugging DNS issues:
Along with some of Frank's picks:
- https://www.youtube.com/watch?v=eQefdC2xDY4
- https://www.youtube.com/watch?v=xtXaxMlFI6M&pp=0gcJCX4JAYcqIYzv
Learning Regex:
Example: let regex = /^([1-9]\d{0,2}(,\d{3})|([1-9]\d))(.\d{2})?$/
From Apple:
- https://developer.apple.com/videos/play/wwdc2022/110357
- https://developer.apple.com/videos/play/wwdc2022/110358
SwiftUI works more consistently if you have a single stable view at the root of your hierarchy.
// Single identity
// .clear option becomes a no-op
ViewWithState()
.background(flag ? .red : .clear)
.animation(.easeInOut(duration: 2), value: flag)As Josh points out, you still get the space taken.
struct ContentView: View {
var body: some View {
VStack {
Image(systemName: "globe")
.imageScale(.large)
.foregroundStyle(.tint)
Text("Hello, world!").opacity(0.0)
Text("a")
}
.padding()
}
}Firebase
A new cohort of the epic instruments workshop is going to run in May:
Josh started a presentation about the tooling that you can build in order to ditch import Combine.
Tools we reviewed this week:
- Subject
- Subscriptions
- ViewModel
One more abstraction to build next week and we will be ready to convert apps.
Source code TBD.
When should you dispatch to the background?
No clear rule. Measure. An example from Josh:
import SwiftUI
@Observable
@MainActor
final class VM {
var names: [String] = []
func sort() async {
async let sortedNames = { [names] in
names.sorted()
}()
names = await sortedNames
}
}Peter brings up the point about re-entrancy. That leads to a discussion about implementing switch map.
- FlatMap in Combine is Merge Map
- FlatMap in AsyncAlgorithms is concatMap
There are many ways to flatten such as exhaustMap.
Here is a manual way of doing it:
@Observable
@MainActor
final class VM {
var names: [String] = []
var sortTask: Task<[String], Error>?
func sort() async {
sortTask?.cancel()
let sortTask = Task.detached { [names] in
try await Task.sleep(for: .seconds(1))
return names.sorted()
}
self.sortTask = sortTask
do {
names = try await sortTask.value
} catch {
switch error {
case is CancellationError: print("task was canceled")
default: print(error.localizedDescription)
}
}
}
}Ed filed feedback on Xcode previews always flipping back to their default (half screen) size.
How can you be sure that a better abstraction isn't slowing down your code too much. How can you measure it? It is a hard problem.
There is a lot of detailed, amazing information on them. Peter wonders where they get the time to make these long, detailed posts.
You can find the pitches (pre-proposal stage) on the forums:
https://forums.swift.org/c/evolution/pitches/5
Some key debugging tips:
You can see the underlying SQL commands: -com.apple.CoreData.SQLDebug 1
10:12:17 From Josh Homann to Everyone: https://www.hackingwithswift.com/quick-start/swiftui/how-to-dismiss-the-keyboard-for-a-textfield
10:13:21 From Josh Homann to Everyone: https://developer.apple.com/documentation/uikit/synchronizing-documents-in-the-icloud-environment
10:18:42 From Ray Fix to Everyone: https://www.pointfree.co/blog/posts/168-sharinggrdb-a-swiftdata-alternative
New in iOS 18 there are notifications for SwiftData that you can lisen to.
Recommended reading for SwiftData:
Mihaela MJ is working on a modular framework. Here is a working sample project
https://github.com/mihaelamj/Formidabble
It is always possible to convert between level and edge based events.
Publishers.Merge(
NotificationCenter.default.publisher(for: NSApplication.willResignActiveNotification).map { _ in false },
NotificationCenter.default.publisher(for: NSApplication.willBecomeActiveNotification).map { _ in true }
)
.prepend(true)Looking deeper at Patterns with Josh (such as the iterator pattern):
extension Sequence {
static func +<Right: Sequence>(lhs: Self, rhs: Right) -> ConcatenatedSequence<Self, Right, Element> {
ConcatenatedSequence(leftSequence: lhs, rightSequence: rhs)
}
}
struct ConcatenatedSequence<Left: Sequence<Value>, Right: Sequence<Value>, Value>: Sequence {
typealias Element = Value
var leftSequence: Left
var rightSequence: Right
func makeIterator() -> Iterator {
.init(leftIterator: leftSequence.makeIterator(), rightIterator: rightSequence.makeIterator())
}
struct Iterator: IteratorProtocol {
typealias Element = Value
var leftIterator: Left.Iterator
var rightIterator: Right.Iterator
mutating func next() -> Value? {
leftIterator.next() ?? rightIterator.next()
}
}
}
let a = [1,2,3] + Set([4,5,6])
for value in a {
print(value)
}extension Sequence {
static func +(lhs: Self, rhs: some Sequence<Element>) -> some Sequence<Element> {
sequence(
state: (
leftIterator: lhs.makeIterator(),
rightIterator: rhs.makeIterator()
)
) { state in
state.leftIterator.next() ?? state.rightIterator.next()
}
}
A new video tutorial from Apple about instruments. 90 minutes long.
If you go to the evolution website:
You can apply the filters "Implemented" and then the versions you are interested in such as Swift 6, Swift 6.1, Swift 6.2 to see what features are available.
An interesting article (via Josh) about a potential future for the industry.
Gemini 2.5 model is new model that does a lot of stuff correctly that other models don't seem to be able to.
Someone mentioned that Claude is good for interactive Vibe coding.
Josh H. presented about the classic "Gang of Four" Design patterns--it is a common lexicon that can be used to communicate with other developers or even machines using prompts.
These focus on object creation mechanisms, promoting better encapsulation and system independence.
- Factory Method: Defines an interface for creating objects, letting subclasses decide the class to instantiate.
- Abstract Factory: Provides an abstract factory class that creates families of related objects.
- Builder: Separates object construction from its representation, enabling different representations through the same process.
- Prototype: Creates objects by cloning existing instances rather than using constructors.
- Singleton: Ensures a class has only one instance and provides global access to it.
These focus on how classes and objects can be composed to form larger structures.
- Adapter: Converts an interface to another, allowing incompatible classes to work together.
- Decorator: Dynamically adds responsibilities to objects by wrapping them in decorator classes.
- Proxy: Acts as a placeholder for an object, controlling access and handling tasks like lazy loading.
- Facade: Provides a simplified interface to a complex system, reducing exposed complexity.
- Composite: Treats individual and composite objects uniformly, useful for tree structures.
- Flyweight: Shares data among multiple objects to reduce memory usage.
These focus on how classes interact and the responsibilities of objects within a system.
- Strategy: Encapsulates algorithms, allowing selection at runtime based on conditions.
- Observer: Establishes a one-to-many dependency, notifying dependents of state changes.
- State: Changes object behavior when its internal state changes.
- Chain of Responsibility: Passes requests along a chain of handlers until one handles it.
- Command: Encapsulates requests as objects for operations like logging and undo/redo.
- Iterator: Accesses aggregate elements sequentially without exposing the structure.
- Mediator: Reduces coupling between classes by encapsulating interactions.
- Memento: Captures and restores object state, useful for undo/redo functionality.
- Visitor: Adds methods to objects without changing their classes, useful for operations across sets of objects.
- Template Method: Defines an algorithm skeleton in a base class, letting subclasses implement specific steps.
Peter mentioned a pattern that he has been looking into
Alex mentioned one of his favorites: "Inversion of Control 🙂"
Ray shared a recent experience with upgrading XCTest to Swift Testing. The migration was straightforward in Xcode and there is a good migration guide.
Related to Swift testing, this proposal means you can use a short description with spaces and punctuation as the name of your test:
Josh also taked about a new addition to the language which lets you better hide implementation details.
Talked about modularization.
You can set the library type to statically or dynamically link packages.
https://developer.apple.com/documentation/packagedescription/product/library(name:type:targets:)
CoreData in packages needs to be handled specially: https://ishabazz.dev/blog/2020/7/5/using-core-data-with-swift-package-manager
From Ed returning integers as a blob of bytes:
extension FixedWidthInteger {
var data: Data {
let data = withUnsafeBytes(of: self) { Data($0) }
return data
}
}From Josh (another way to deserialize)
enum JSON {
indirect case array([JSON])
indirect case dictionary([String: JSON])
case boolean(Bool)
case number(Double)
case string(String)
case null
}
extension JSON: Decodable {
init(from decoder: Decoder) throws {
self = try Result { try decoder.singleValueContainer() }
.flatMap { container in
container.decodeNil()
? .success(JSON.null)
: Result { JSON.boolean(try container.decode(Bool.self)) }
.flatMapError { _ in Result { JSON.number(try container.decode(Double.self)) } }
.flatMapError { _ in Result { JSON.string(try container.decode(String.self)) } }
.flatMapError { _ in Result { JSON.array(try container.decode([JSON].self)) } }
.flatMapError { _ in Result { JSON.dictionary(try container.decode([String: JSON].self)) } }
}.get()
}
}How to cleanup space on your disk.
-
A free app from OmniGroup:
MutableSpan: https://github.com/swiftlang/swift-evolution/blob/main/proposals/0467-MutableSpan.md
To understand borrowing and consuming we looked at some of the
static func embiggened(_ value: [Int]) -> [Int] {
var mutableValue = value
for index in mutableValue.indices {
mutableValue[index] += 1
}
return mutableValue
}
static func embiggened(byBorrowing value: borrowing [Int]) -> [Int] {
var mutableValue = copy value
for index in mutableValue.indices {
mutableValue[index] += 1
}
return mutableValue
}
static func embiggen(byExclusiveBorrow value: inout [Int]) {
for index in value.indices {
value[index] += 1
}
}
static func embiggen(byConsuming value: consuming [Int]) -> [Int] {
for index in value.indices {
value[index] += 1
}
return consume value
}
let a = [1, 2, 3]
let b = embiggen(byConsuming: a)
print(a,b)Josh continued with a topic from last week about how to replace combine
with modern Swift concurrency. This week Josh created a Pipe abstraction
to allow multiple observers of a sent value (much like notification center).
import Foundation
import Synchronization
public final class Pipe<Value: Sendable>: Sendable, AsyncSequence {
public typealias Stream = AsyncStream<Element>
public typealias AsyncIterator = Stream.AsyncIterator
public typealias Element = Value
private let lockedContinuations: Mutex<[UUID: Stream.Continuation]>
private let replayCount: Int
public init(replay: Int = 0) {
replayCount = replay
lockedContinuations = .init([:])
}
deinit {
lockedContinuations.withLock { continuations in
continuations.values.forEach { $0.finish() }
}
}
public func send(_ value: Value) {
lockedContinuations.withLock { continuations in
continuations.values.forEach { $0.yield(value) }
}
}
public func makeAsyncIterator() -> AsyncIterator {
let (stream, continuation) = Stream.makeStream(of: Element.self,
bufferingPolicy: .bufferingNewest(replayCount))
let id = UUID()
continuation.onTermination = { [weak self] _ in
self?.lockedContinuations.withLock { $0[id] = nil }
}
lockedContinuations.withLock { $0[id] = continuation }
return stream.makeAsyncIterator()
}
}James Dempsey has a new online course that teaches the ins and outs of Apple Instruments:
Also, there is a new Processor Trace Instrument that uses low level hardward on the M4 and iPhone 16 to collect very detailed metrics about performance.
https://developer.apple.com/documentation/xcode/analyzing-cpu-usage-with-processor-trace?changes=la
Chatgpt Xcode: https://help.openai.com/en/articles/10119604-work-with-apps-on-macos
macOS VM: https://arstechnica.com/gadgets/2022/07/how-to-use-free-virtualization-apps-to-safely-test-the-macos-ventura-betas/
- NSUnibiquitousKeyValueStore https://developer.apple.com/documentation/foundation/nsubiquitouskeyvaluestore
- CKAsset to sync user data: https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/CloudKitQuickStart/AddingAssetsandLocations/AddingAssetsandLocations.html#//apple_ref/doc/uid/TP40014987-CH6-SW2
Ways to crunch down the JSON so it can be URL encoded.
- https://www.whynotestflight.com/excuses/how-do-custom-encoders-work/
- https://github.com/SomeRandomiOSDev/CBORCoding
- https://cbor.io/impls.html
- https://msgpack.org
Using a server:
A large infrastructure:
Smaller deployments:
- https://fosdem.org/2025/schedule/event/fosdem-2025-4592-your-first-aws-lambda-function/
- https://rambo.codes/posts/2021-12-06-using-cloudkit-for-content-hosting-and-feature-flags
- https://newsletter.pragmaticengineer.com/p/trimodal
- https://www.levels.fyi/t/software-engineer?countryId=254
Previously, Josh demostrated how SwiftUI can use Combine to achieve lazy initialization and prevent repeated re-initialization of a view model of a view in a timeline view using StateObject.
Inspired by this blog post:
Josh created a special property wrapper ViewModel that does the same thing and means you don't need to use StateObject or derive from Combine's ObservableObject.
import SwiftUI
import PlaygroundSupport
PlaygroundPage.current.setLiveView(ContentView())
struct ContentView: View {
var body: some View {
TimelineView(.periodic(from: .now, by: 3)) { _ in
let _ = print("-----------\(Date.now)-----------")
V()
}
}
}
struct V: View {
var vm = VM("naked var")
@State var vm0 = VM("@State")
@ViewModel var vm1 = VM("@ViewModel")
var body: some View {
Text(vm.text)
Text(vm0.text)
Text(vm1.text)
}
}
@Observable
final class VM {
var text: String
init(_ text: String) {
self.text = text
print("Init \(text)")
}
deinit {
print("Deinit \(text)")
}
}Here is the property wrapper:
@propertyWrapper
struct ViewModel<Wrapped: AnyObject & Observable>: DynamicProperty {
@State private var reference: Reference
var wrappedValue: Wrapped {
reference.value
}
var projectedValue: Bindable<Wrapped> {
reference.bindable
}
init(wrappedValue make: @autoclosure @escaping () -> Wrapped) {
_reference = State(wrappedValue: Reference(make))
}
}
extension ViewModel {
final class Reference {
private var viewModel: Wrapped?
private let makeViewModel: () -> Wrapped
lazy var value: Wrapped = makeViewModel()
lazy var bindable = { Bindable(value) }()
init(_ make: @escaping () -> Wrapped) {
makeViewModel = make
}
}
}There were a lot of Swift topics presented at this years FOSDEM (Free Open Source Developers European Meeting) that have been organized for viewing here:
A new book about SwiftUI from Natalia Panferova of nilcoalecing is available. Bob DeLaurentis says that it does a great job in explaining some of the subtleties of the framework.
This led to a discussion about books and apps for reading ebooks.
- Remarkable: https://remarkable.com (https://www.amazon.com/dp/B0CZ9VFQ2P)
- Meebook ebook reader
- https://www.amazon.ae/AZMXDVP-Meebook-P78-Adjustable-Micro-SD/dp/B09Q37DFJ7
- https://www.liquidtext.net
- Boox Palma: https://shop.boox.com/products/palma
- https://supernote.com/products/supernote-nomad
Led by Peter and Josh, we discussed concurrency and the tools to guarantee forward progress.
To visualize / test restricting cooperative thread pool: https://alejandromp.com/development/blog/limit-swift-concurrency-cooperative-pool/
A key insight is the ability to use LIBDISPATCH_COOPERATIVE_POOL_STRICT=1 to make sure forward progress is always being made.
This is the thread on forum that goes in-depth on lock ownership and safety in using across suspension point https://forums.swift.org/t/incremental-migration-to-structured-concurrency/54939/5
Assert that you are on a specific queue https://developer.apple.com/documentation/dispatch/dispatchprecondition(condition:)
10:33:29 From Mihaela MJ to Everyone: https://github.com/siteline/swiftui-introspect
Josh gave us a tour of proposal 0461 and how it makes things more similar between sync and async methods.
import Foundation
final class Q {
func sync() {
MyActor.assertIsolated()
print("synchronous Q")
}
nonisolated func nonSync() async {
MyActor.assertIsolated()
print("asynchronous Q")
}
}
@MyActor
final class P {
var q = Q()
func doStuff() async {
q.sync()
async let v = q.nonSync()
let _ = await v
}
}
@globalActor
actor MyActor: GlobalActor {
static let shared = MyActor()
private init() { }
}
Task {
let p = await P()
await p.doStuff()
}Some useful tools!
- https://forums.swift.org/t/review-sf-0007-introducing-swift-subprocess/70337
- https://github.com/apple/swift-argument-parser
Also, some code from Carlyn:
@discardableResult
func shellOneShot(_ command: some StringProtocol) throws -> String {
let task = Process()
let pipe = Pipe()
task.standardOutput = pipe
task.standardError = pipe
task.arguments = ["-c", command]
//task.currentDirectoryURL
//task.qualityOfService
//task.environment = ProcessInfo.processInfo.environment
task.standardInput = nil
task.executableURL = URL(fileURLWithPath: "/bin/zsh")
try task.run()
let data = pipe.fileHandleForReading.readDataToEndOfFile()
let output = String(data: data, encoding: .utf8)!
task.waitUntilExit()
if task.terminationStatus == 0 || task.terminationStatus == 2 {
return output
} else {
print(output)
throw CustomProcessError.unknownError(exitCode: task.terminationStatus)
}
}
@discardableResult
func runProcess(_ tool:URL, arguments:[some StringProtocol] = [], workingDirectory:URL? = nil) throws -> String {
let task = Process()
let pipe = Pipe()
task.standardOutput = pipe
task.standardError = pipe
task.arguments = arguments
if let workingDirectory {
task.currentDirectoryURL = workingDirectory
}
//task.qualityOfService
//task.environment
task.standardInput = nil
task.executableURL = tool
try task.run()
let data = pipe.fileHandleForReading.readDataToEndOfFile()
let output = String(data: data, encoding: .utf8)!
task.waitUntilExit()
if task.terminationStatus == 0 || task.terminationStatus == 2 {
return output
} else {
print(output)
throw CustomProcessError.unknownError(exitCode: task.terminationStatus)
}
}
enum CustomProcessError: Error {
case unknownError(exitCode: Int32)
}Apparently there was an interesting (mostly non-code meeting) by Apple last week about how to develop "experiences" of vision pro. Ed atteneded online and John B was there in-person. Four sessions over the course of the day.
Apparently they had a demo where they showed how to render the experience of being on the moon.
Environment metrics
Geometry: 20K-500K total triangles
View: -100K triangles per camera angle
Memory: Less than 250MB total texture data
Entities: Under 200 draw calls
Materials: Unlit with custom shader effects
Questions from Rainer about how to use concurrency effectively in legacy code.
We talked about where things run and how the default might change in future versions of Swift.
Link from Peter:
Examples from Josh:
struct A {
//@MainActor
nonisolated func a() {
Task {
MainActor.assertIsolated()
}
}
}
Task {
A().a()
}
Instead of falling back to using Combine (which bring tech debt with it), a suggestion from Josh to make simple abstractions to avoid creating Tasks everywhere.
extension AsyncSequence where Failure == Never {
func subscribe<Unretained: AnyObject>(withUnretained object: Unretained, onNext: @escaping (Unretained, Element) -> Void) -> Task<Void, Never> {
Task { [weak object] in
for await value in self {
guard let object else { return }
onNext(object, value)
}
}
}
}Can be used like this:
actor A {
var subscription: Task<Void, Never>?
func a() {
let (output, input) = AsyncStream.makeStream(of: Int.self, bufferingPolicy: .bufferingNewest(1))
subscription = output.subscribe(withUnretained: self) { unretained, value in
print(unretained, value)
}
input.yield(1)
input.yield(2)
input.yield(3)
}
}This came up in the context of Peter's custom image caching problem.
Some notes from Carlyn:
- https://www.whynotestflight.com/excuses/how-to-do-some-basic-file-handling/
- https://forums.swift.org/t/what-is-the-best-way-to-work-with-the-file-system/71020/17
- https://github.com/apple/swift-nio-examples/blob/4bd02d14e6309bbd722b64f6de17855326aa1145/backpressure-file-io-channel/Sources/BackpressureChannelToFileIO/FileIOChannelWriteCoordinator.swift#L17
- https://github.com/apple/swift-nio/tree/5f60ceeca072475252ca1ad747bd1156a370fe5d/Sources/NIOFileSystem
Using custom executors (Josh)
- https://github.com/swiftlang/swift-evolution/blob/main/proposals/0392-custom-actor-executors.md
- https://www.swift.org/migration/documentation/swift-6-concurrency-migration-guide/incrementaladoption
actor LandingSite {
private let queue = DispatchSerialQueue(label: "something")
nonisolated var unownedExecutor: UnownedSerialExecutor {
queue.asUnownedSerialExecutor()
}
func acceptTransport(_ transport: PersonalTransportation) {
// this function will be running on queue
}
}10:35:09 From carlyn to Everyone: private func appendData(data: Data) throws { let fileHandle = try FileHandle(forWritingTo: storageUrl) fileHandle.seekToEndOfFile() fileHandle.write(data) fileHandle.closeFile() }
Creating a custom global actor:
@globalActor actor SharedActor {
static let shared = SharedActor()
}
@SharedActor final class A { }
@SharedActor final class B { }- Actor all implicitly conform to the Actor protocol https://developer.apple.com/documentation/swift/actor
- Swift Concurrency and Instruments https://developer.apple.com/videos/play/wwdc2022/110350
Starting with Package definitions. From MJ
// Dependency grouping
enum Dependencies {
static var common: [Target.Dependency] {
[
.product(name: "Difference", package: "Difference"),
.product(name: "LifetimeTracker", package: "LifetimeTracker"),
]
}
}
.target(
name: "SharedModels",
dependencies:
Dependencies.common + [
"AutomaticSettings",
]
),These ideas come from:
Related:
@_exported import PackageNameFor details see:
- New Junior Developers Can’t Actually Code: https://nmn.gl/blog/ai-and-learning
- Cybersecurity and AI https://cset.georgetown.edu/publication/cybersecurity-risks-of-ai-generated-code/
- Swift Navigation https://github.com/pointfreeco/swift-navigation
Hex Tac Toe is waiting for Apple beta review. Anyone else want to be on the beta, send your Apple email (DM). I have all the ones from before.
Peter worked on a caching system for an app and wanted feedback for how it could be improved. The basic app is here:
https://github.com/PeterWu9/Recipes
A recommendation from Josh to use the headers in the HTTP response headers:
Also related:
-
https://developer.apple.com/documentation/foundation/nsurlcache
-
Async file reading https://losingfight.com/blog/2024/04/22/reading-and-writing-files-in-swift-asyncawait/
View builder returns some View which is a container view like ConditionalContent.
struct W: View {
let a: Int
@ViewBuilder
var body: some View {
switch a {
case ..<0: Text("Negative")
case 0: Text("Zero")
case 1... : Color.green
default: EmptyView()
}
}
}Joe shared this SwiftUI navigation bug:
struct ContentView: View {
var body: some View {
NavigationStack {
NavigationLink {
Text("Do not tap back, you'll regret it")
.toolbarBackground(.visible, for: .navigationBar)
.toolbarBackground(Color.orange, for: .navigationBar)
.toolbarColorScheme(.dark, for: .navigationBar)
} label: {
VStack {
Text("First page is the sweetest")
}
.padding()
}
.navigationTitle("First Page")
.toolbarBackground(.visible, for: .navigationBar)
.toolbarBackground(Color.orange, for: .navigationBar)
.toolbarColorScheme(.dark, for: .navigationBar)
}
}
}Sample from Josh:
withAnimation(animation, completionCriteria: .logicallyComplete) {
operation()
} completion: {
continuation.resume()
}-
Creating a multi-platform framework bundle. https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle/
-
Integer generic parameters are going to be a thing. https://github.com/swiftlang/swift-evolution/blob/main/proposals/0452-integer-generic-parameters.md
-
New InlineArray type. https://github.com/swiftlang/swift-evolution/blob/main/proposals/0453-vector.md
-
Transferable protocol https://developer.apple.com/documentation/CoreTransferable/Transferable
- App Intents https://developer.apple.com/videos/play/wwdc2024/10134/
- Guided Access https://www.theseniorlist.com/cell-phones/assistive-access/
- https://www.ninjaone.com/blog/ipad-kiosk-mode/
09:57:53 From Josh Homann to Everyone: Request sharing in FaceTime: https://support.apple.com/guide/iphone/request-give-remote-control-a-facetime-call-iph5d70f34a3/ios
Puzzle from John Brewer
var test3 = [-1, 1, 2, 3, 4, -1, -9, -6, 10, 1, -5]
print(largestSumSpan(array: test3)) // [10, 1]
var test4 = [-1, 1, 2, 3, 4, -1, -9, -6, 8, 1, -5]
print(largestSumSpan(array: test4)) // [1, 2, 3, 4]What is the best idiomatic Swift to handle this?
print(missingPair([1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 7, 6, 5, 4, 3, 2, 1]))
9There is a "trick" to this one which to xor all of the bits.
Related book
- Peter was able to make a common target that other targets could depend on.
Exciting announcement Carlyn let us know about is that Swift Build (used by Xcode) is, as of today, an open source technology. It will support Windows and Linux.
Also, the official announcement:
https://www.swift.org/blog/the-next-chapter-in-swift-build-technologies/
We looked at conditional package inclusion. You can conditionalize based on platform but it doesn't look like there are too many other options.
An example from Mihaela:
.product(name: "ResChatHouUIKit", package: "ResChatHouUIKit", condition: .when(platforms: [.iOS])),
.product(name: "ResChatUIKit", package: "ResChatUIKit", condition: .when(platforms: [.iOS])),
.product(name: "ResChatHouAppKit", package: "ResChatHouAppKit", condition: .when(platforms: [.macOS])),
.product(name: "ResChatAppKitUI", package: "ResChatAppKitUI", condition: .when(platforms: [.macOS])),
]
),Now supports Swift 6. You may need to remove previous versions.
Ed is working on his game hex-tac-toe. Lots of suggestions for how to improve.
It is an open source airdrop thing but written in Flutter:
Josh demo'ed LLMs including deepseek on your local machine:
You can run in from within a UI too that supports many models.
- How to share resources among multiple Swift packages.
- Continued working on Mine Sweeper
We modernized a small app to Swift 6. Making a type CoW and isolating all mutation allows you to declare a type sendable. The mutable state is not shared so these properties can be marked sendable (unsafe).
Measure the performance of a new collection type using the Swift performance package.
https://www.swift.org/blog/benchmarks/
Continued the mine sweeper example.
We spent some time debugging a problem with a SceneKit app that was leaking audio players.
Rainer was trying to animate text along a Bézier curve.
Josh reminded us of this project example from last year:
Also, a Primer on Bézier curves: https://pomax.github.io/bezierinfo/
Rainer noted that the example he was trying to emulate:
His code here:
This week we looked at a serious performance problem in what we built so far. Changing the color of a handful of tile taking almost a second to perform.
A nice video from Ben Cohen about Fast Safe Mutable State:
An internal way to do in-place mutation:
- https://jano.dev/apple/2024/12/10/Modify-and-Yield.html
- https://forums.swift.org/t/modify-accessors/31872
But the biggest performance win was had by using a properly identifiable type in the ForEach statement of the grid.
- Ed is making a game where he needs to match n distinct items in a row. Josh offered a solution in functional swift:
- We start with an assumption that we have a node, a sequence of adjacencies that can transform a node into another node, and the number of distinct items we want to match
let n = 6
let adjacency: some Sequence<(Node) -> Node?>
let node: Node- We can express the algorithm we want to apply as a node represents a winning state if there is a way to transform it into a sequence of n distinct elements. or more formally:
- Equivalently in swift:
let isWon = adjacency.contains { [node, n] adjacency in
Set(sequence(first: node) { adjacency(node)}.prefix(n))).count == n
}- We can further express our intent with the use of explanatory variables:
let isWon = adjacency.contains { [node, n] adjacency in
let adjacentUnique = Set(sequence(first: node) { adjacency(node)}.prefix(n))
let isWinningRun = adjacentUnique.count == n
return isWinningRun
}- Ed asked how to get the winning nodes. We can do this by changing the operator to
compactMap:
let winningSets = adjacency.compactMap { [node, n] adjacency in
let adjacentUnique = Set(sequence(first: node) { adjacency(node)}.prefix(n))
let isWinningRun = adjacentUnique.count == n
return isWinningRun ? adjacentUnique : nil
}
.reduce(into: Set<Node>()) { $0.formUnion($1) }- We updated the Layout to use a cache and added a viewModel:
@Observable
final class ViewModel: ObservableObject {
private(set) var cells: Grid2D<Cell> = .init(rows: 8, columns: 8) { x, y in
.init(id: x + y * 8, position: .init(x, y), color: .allCases.randomElement()!)
}
func tap(index: SIMD2<Int>) {
cells[index].color = .blue
}
}
struct Cell: Identifiable, Hashable {
let id: Int
let position: SIMD2<Int>
var color: ViewModel.BoardColor
}
extension ViewModel {
enum BoardColor: Hashable, CaseIterable {
case red, green, blue
}
}
struct ContentView: View {
@StateObject private var viewModel = ViewModel()
var body: some View {
Board(dimension: 8) {
ForEach(viewModel.cells.indices, id: \.self) { index in
Group {
switch viewModel.cells[index].color {
case .red: Color.red
case .green: Color.green
case .blue: Color.blue
}
}
.onTapGesture {
viewModel.tap(index: viewModel.cells[index].position)
}
.boardPosition(index)
}
}
}
}
extension View {
func boardPosition(_ position: SIMD2<Int>) -> some View {
layoutValue(key: BoardPosition.self, value: position)
}
func boardPosition(x: Int, y: Int) -> some View {
boardPosition(.init(x, y))
}
}
struct Board: Layout {
let dimension: Int
func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout Cache) -> CGSize {
let size = proposal.replacingUnspecifiedDimensions(by: .zero)
let minimumDimension = min(size.width, size.height)
return .init(width: minimumDimension, height: minimumDimension)
}
func placeSubviews(in bounds: CGRect, proposal: ProposedViewSize, subviews: Subviews, cache: inout Cache) {
if cache.bounds != bounds {
cache.bounds = bounds
cache.cellSize = CGSize(width: bounds.width / Double(dimension), height: bounds.height / Double(dimension))
let transform = CGAffineTransform
.identity
.translatedBy(x: bounds.origin.x, y: bounds.origin.y)
.scaledBy(x: cache.cellSize.width, y: cache.cellSize.height)
cache.grid = .init(rows: dimension, columns: dimension) { x, y in
CGPoint(x: x, y: y).applying(transform)
}
}
for view in subviews {
let position = cache.grid[safe: view[BoardPosition.self]] ?? bounds.origin
view.place(
at: position,
proposal: .init(cache.cellSize)
)
}
}
func makeCache(subviews: Subviews) -> Cache {
.init()
}
struct Cache {
var bounds = CGRect.zero
var cellSize = CGSize.zero
var grid: Grid2D<CGPoint> = .init(repeating: .zero, rows: 0, columns: 0)
}
}
struct BoardPosition: LayoutValueKey {
static let defaultValue = SIMD2<Int>.zero
}