# SwiftLee

A weekly blog about Swift, SwiftUI and Xcode Tips and Tricks

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## SwiftUI Agent Skill: Install and use with AI coding tools

DevFeed: [SwiftUI Agent Skill: Install and use with AI coding tools](<https://devfeed.tech/articles/swiftui-agent-skill-install-and-use-with-ai-coding-tools-17429.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/ai-development/swiftui-agent-skill-build-better-views-with-ai/>)

Author: Antoine van der Lee

Published: 2026-09-14T11:49:33Z

Content type: article

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [SwiftUI](<https://devfeed.tech/topics/swiftui.md>), [Agent Skill](<https://devfeed.tech/topics/agent-skill.md>), [ai-coding](<https://devfeed.tech/topics/ai-coding.md>), [Code quality](<https://devfeed.tech/topics/code-quality.md>), [context window](<https://devfeed.tech/topics/context-window.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>)

Tags: [agent-skill](<https://devfeed.tech/tags/agent-skill.md>), [ai-coding](<https://devfeed.tech/tags/ai-coding.md>), [ai-development](<https://devfeed.tech/tags/ai-development.md>), [cli](<https://devfeed.tech/tags/cli.md>), [code-quality](<https://devfeed.tech/tags/code-quality.md>), [context-window](<https://devfeed.tech/tags/context-window.md>), [installation](<https://devfeed.tech/tags/installation.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [swiftui](<https://devfeed.tech/tags/swiftui.md>)

### AI overview

This article introduces an open-source SwiftUI Agent Skill for AI coding tools. The skill helps agents build or refactor SwiftUI views, improve generated code quality, and load focused references only when they are relevant to a task. It also explains installation, updates, and compatibility considerations for the skills command-line tool.

### Source excerpt

A SwiftUI Agent Skill that helps you build better views or refactor existing ones. It's the reality we're in today, and I honestly can't live without it anymore myself. Several skills helped me improve the code quality produced by agents, and I'm happy to introduce you to my open-source skill for SwiftUI. Before reading this ... -> The post SwiftUI Agent Skill: Install and use with AI coding tools appeared first on SwiftLee.

## The iOS Simulator Inside Cursor, Claude Code, and Codex

DevFeed: [The iOS Simulator Inside Cursor, Claude Code, and Codex](<https://devfeed.tech/articles/the-ios-simulator-inside-cursor-claude-code-and-codex-11482.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/ai-development/the-ios-simulator-inside-cursor-claude-code-and-codex/>)

Author: Antoine van der Lee

Published: 2026-09-07T13:07:15Z

Content type: opinion

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [iOS](<https://devfeed.tech/topics/ios.md>), [cursor](<https://devfeed.tech/topics/cursor.md>), [Claude Code](<https://devfeed.tech/topics/claude-code.md>), [codex](<https://devfeed.tech/topics/codex.md>), [App](<https://devfeed.tech/topics/app.md>), [Tooling](<https://devfeed.tech/topics/tooling.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [agent-skills](<https://devfeed.tech/tags/agent-skills.md>), [ai-development](<https://devfeed.tech/tags/ai-development.md>), [app-development](<https://devfeed.tech/tags/app-development.md>), [claude-code](<https://devfeed.tech/tags/claude-code.md>), [codex](<https://devfeed.tech/tags/codex.md>), [cursor](<https://devfeed.tech/tags/cursor.md>), [developer-tools](<https://devfeed.tech/tags/developer-tools.md>), [ios](<https://devfeed.tech/tags/ios.md>)

### AI overview

An opinion article examines how the iOS Simulator is becoming integrated into Cursor, Claude Code, and Codex as app development shifts toward orchestrating AI agents. It argues that visual testing, performance review, and critical human validation remain essential, and describes AI Agents for the iOS Simulator as a way to automate navigation and validation within the developer workflow.

### Source excerpt

App development is changing, and the iOS Simulator is too, as it starts to appear in Cursor, Claude Code, and Codex in different ways. I've been developing apps since 2009 and the RocketSim developer tool since 2019, and I can tell we're reinventing ourselves like never before. I also started to wonder: what is the ... -> The post The iOS Simulator Inside Cursor, Claude Code, and Codex appeared first on SwiftLee.

## MVVM in SwiftUI: Using view models without overengineering

DevFeed: [MVVM in SwiftUI: Using view models without overengineering](<https://devfeed.tech/articles/mvvm-in-swiftui-using-view-models-without-overengineering-11488.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/swiftui/mvvm-architectural-coding-pattern-to-structure-views/>)

Author: Antoine van der Lee

Published: 2026-08-31T13:10:23Z

Content type: tutorial

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [SwiftUI](<https://devfeed.tech/topics/swiftui.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [developers](<https://devfeed.tech/tags/developers.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [swiftui](<https://devfeed.tech/tags/swiftui.md>)

### AI overview

This tutorial explains how to use the MVVM architectural pattern in SwiftUI. It describes separating views from presentation state and actions through view models, while emphasizing that view models should be introduced when they provide meaningful organization or testability rather than added to every view.

### Source excerpt

MVVM in SwiftUI separates a view's presentation from the state and actions behind it. A view model exposes the values a view displays and handles work such as loading, validation, or deletion, while the view remains focused on rendering. SwiftUI already provides powerful tools for state management, so not every view needs a view model. I ... -> The post MVVM in SwiftUI: Using view models without overengineering appeared first on SwiftLee.

## @StateObject vs. @ObservedObject: The differences explained

DevFeed: [@StateObject vs. @ObservedObject: The differences explained](<https://devfeed.tech/articles/stateobject-vs-observedobject-the-differences-explained-11489.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/swiftui/stateobject-observedobject-differences/>)

Author: Antoine van der Lee

Published: 2026-08-24T14:05:36Z

Content type: article

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [SwiftUI](<https://devfeed.tech/topics/swiftui.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [framework](<https://devfeed.tech/tags/framework.md>), [ios](<https://devfeed.tech/tags/ios.md>), [model](<https://devfeed.tech/tags/model.md>), [observedobject](<https://devfeed.tech/tags/observedobject.md>), [propertywrapper](<https://devfeed.tech/tags/propertywrapper.md>), [published](<https://devfeed.tech/tags/published.md>), [rebuilds](<https://devfeed.tech/tags/rebuilds.md>), [stateobject](<https://devfeed.tech/tags/stateobject.md>), [swiftui](<https://devfeed.tech/tags/swiftui.md>)

### AI overview

This article explains the difference between SwiftUI's @StateObject and @ObservedObject property wrappers. Use @StateObject when a view creates and owns an ObservableObject, and use @ObservedObject when the object is supplied by another view. It also explains how inline object creation can reset view models, contrasts these wrappers with the ObservableObject protocol, and recommends the Observation framework for new code targeting iOS 17 and later.

### Source excerpt

@StateObject and @ObservedObject both connect an ObservableObject to a SwiftUI view. The key difference is ownership: use @StateObject when the view creates the object and @ObservedObject when the view receives it from elsewhere. Choosing the wrong wrapper can cause your model to be recreated whenever SwiftUI rebuilds a view. I made this mistake myself because both wrappers initially appeared to produce the same result. ... -> The post @StateObject vs. @ObservedObject: The differences explained appeared first on SwiftLee.

## Swift Testing explained with code examples

DevFeed: [Swift Testing explained with code examples](<https://devfeed.tech/articles/swift-testing-explained-with-code-examples-11484.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/swift-testing/modern-unit-test/>)

Author: Antoine van der Lee

Published: 2026-08-17T08:51:15Z

Content type: tutorial

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [examples](<https://devfeed.tech/tags/examples.md>), [net-conf](<https://devfeed.tech/tags/net-conf.md>), [swift](<https://devfeed.tech/tags/swift.md>), [swift-testing](<https://devfeed.tech/tags/swift-testing.md>), [testing](<https://devfeed.tech/tags/testing.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

This tutorial introduces Swift Testing, the modern Swift testing framework built around expressive macros such as @Test, #expect, and #require. It explains how Swift Testing replaces XCTest, reduces repetitive boilerplate, defines tests globally, and organizes them with structs, traits, and tags.

### Source excerpt

Swift Testing is the modern framework for writing tests in Swift, built around expressive macros like @Test, #expect, and #require. It's the successor to XCTest and the default testing framework for new projects in Xcode. Instead of dozens of assertion methods, you work with a single expressive macro that tells you exactly why a test ... -> The post Swift Testing explained with code examples appeared first on SwiftLee.

## Sendable and @Sendable closures explained with code examples

DevFeed: [Sendable and @Sendable closures explained with code examples](<https://devfeed.tech/articles/sendable-and-sendable-closures-explained-with-code-examples-11487.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/swift/sendable-protocol-closures/>)

Author: Antoine van der Lee

Published: 2026-08-09T11:53:15Z

Content type: article

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>), [Code](<https://devfeed.tech/topics/code.md>), [async/await](<https://devfeed.tech/topics/async-await.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [examples](<https://devfeed.tech/tags/examples.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This article explains Swift's Sendable protocol and the @Sendable closure attribute. It describes how the compiler checks whether values can safely cross concurrency domains such as actors, tasks, and threads, including examples involving value types, classes, generics, and enums with associated values.

### Source excerpt

Sendable is a protocol in Swift that indicates a type is safe to share across concurrency domains like actors, tasks, and threads. When a type conforms to Sendable, the compiler verifies at compile time that passing it around can't introduce data races. Together with the @Sendable attribute for closures, it's one of the core building ... -> The post Sendable and @Sendable closures explained with code examples appeared first on SwiftLee.

## @MainActor in Swift explained with code examples

DevFeed: [@MainActor in Swift explained with code examples](<https://devfeed.tech/articles/mainactor-in-swift-explained-with-code-examples-11486.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/swift/mainactor-dispatch-main-thread/>)

Author: Antoine van der Lee

Published: 2026-08-02T12:04:47Z

Content type: tutorial

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Code](<https://devfeed.tech/topics/code.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>)

Tags: [article](<https://devfeed.tech/tags/article.md>), [code](<https://devfeed.tech/tags/code.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [dispatchqueue](<https://devfeed.tech/tags/dispatchqueue.md>), [examples](<https://devfeed.tech/tags/examples.md>), [guide](<https://devfeed.tech/tags/guide.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [main-thread](<https://devfeed.tech/tags/main-thread.md>), [swift](<https://devfeed.tech/tags/swift.md>), [thread](<https://devfeed.tech/tags/thread.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

This tutorial explains how Swift's @MainActor global actor ensures that properties, methods, instances, and closures execute on the main thread. It also covers compiler-enforced main-thread execution, global actor isolation, nonisolated methods, and changes to default actor isolation in Swift 6.2 and Xcode 26.

### Source excerpt

@MainActor is a global actor that performs its tasks on the main thread. You can use it to dispatch to the main thread by marking properties, methods, instances, or closures with the attribute. Instead of manually dispatching using DispatchQueue.main.async, you let the compiler enforce main thread execution for you. If you're new to Actors in ... -> The post @MainActor in Swift explained with code examples appeared first on SwiftLee.

## How to free up Xcode disk space safely with an AI Agent

DevFeed: [How to free up Xcode disk space safely with an AI Agent](<https://devfeed.tech/articles/how-to-free-up-xcode-disk-space-safely-with-an-ai-agent-11481.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/ai-development/how-to-free-up-xcode-disk-space-safely-with-an-ai-agent/>)

Author: Antoine van der Lee

Published: 2026-07-27T08:34:16Z

Content type: tutorial

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [Xcode](<https://devfeed.tech/topics/xcode.md>), [AI Agent](<https://devfeed.tech/topics/ai-agent.md>), [Agent Skill](<https://devfeed.tech/topics/agent-skill.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [agent-skill](<https://devfeed.tech/tags/agent-skill.md>), [agent-skills](<https://devfeed.tech/tags/agent-skills.md>), [ai-agent](<https://devfeed.tech/tags/ai-agent.md>), [ai-development](<https://devfeed.tech/tags/ai-development.md>), [derived-data](<https://devfeed.tech/tags/derived-data.md>), [developer-tools](<https://devfeed.tech/tags/developer-tools.md>), [disk-space](<https://devfeed.tech/tags/disk-space.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [workflow](<https://devfeed.tech/tags/workflow.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

This tutorial explains why Xcode can consume substantial disk space, especially when multiple AI agents use separate Git worktrees. It introduces an open-source Xcode Disk Cleanup Agent Skill that searches common storage locations and requires explicit approval before deleting anything.

### Source excerpt

Xcode disk space can grow rapidly without you noticing. Especially these days, with multiple agents turning multiple worktrees into silent disk space occupiers. Where I used to only focus on deleting old Simulators every now and then, I'm now also actively managing worktrees and derived data folders. There are great Mac apps and open-source projects ... -> The post How to free up Xcode disk space safely with an AI Agent appeared first on SwiftLee.

## How to Test iOS Apps in Different Time Zones on a Physical iPhone

DevFeed: [How to Test iOS Apps in Different Time Zones on a Physical iPhone](<https://devfeed.tech/articles/how-to-test-ios-apps-in-different-time-zones-on-a-physical-iphone-11490.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/xcode/ios-time-zone-testing-physical-iphone/>)

Author: Antoine van der Lee

Published: 2026-07-20T12:27:42Z

Content type: tutorial

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [iOS](<https://devfeed.tech/topics/ios.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [USB](<https://devfeed.tech/topics/usb.md>)

Tags: [how-to](<https://devfeed.tech/tags/how-to.md>), [ios](<https://devfeed.tech/tags/ios.md>), [iphone](<https://devfeed.tech/tags/iphone.md>), [simulator](<https://devfeed.tech/tags/simulator.md>), [testing](<https://devfeed.tech/tags/testing.md>), [usb](<https://devfeed.tech/tags/usb.md>), [validation](<https://devfeed.tech/tags/validation.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

This tutorial explains how to test iOS apps across time zones on a physical iPhone or iPad using RocketSim, Xcode 27, and a USB connection. Simulating a location lets iOS update the device's system time zone, enabling validation of behaviors such as local time changes, focus modes, and driving mode. The workflow requires specific device settings, Developer Mode, and an app launched from Xcode; Xcode 27 is identified as being in beta in the supplied text.

### Source excerpt

Testing iOS Time Zones is a typical validation path that's difficult without actually traveling yourself. You can apply all kinds of protocols and mock versions of your app, but having iOS act like it's actually traveling between time zones is a real challenge. Ideally, you'd test apps like travel apps in such a way that ... -> The post How to Test iOS Apps in Different Time Zones on a Physical iPhone appeared first on SwiftLee.

## User Diagnostics Reports: Solving app bugs faster with AI Agents

DevFeed: [User Diagnostics Reports: Solving app bugs faster with AI Agents](<https://devfeed.tech/articles/user-diagnostics-reports-solving-app-bugs-faster-with-ai-agents-11483.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/debugging/introducing-diagnostics-improved-debugging-and-user-support/>)

Author: Antoine van der Lee

Published: 2026-07-13T07:21:09Z

Content type: article

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [App](<https://devfeed.tech/topics/app.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [bug](<https://devfeed.tech/topics/bug.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>), [HTML](<https://devfeed.tech/topics/html.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [Artificial Intelligence](<https://devfeed.tech/topics/ai.md>)

Tags: [ai-agents](<https://devfeed.tech/tags/ai-agents.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [debugging](<https://devfeed.tech/tags/debugging.md>), [diagnostics](<https://devfeed.tech/tags/diagnostics.md>), [html](<https://devfeed.tech/tags/html.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

### AI overview

The article introduces Diagnostics, an open source library for app support and bug investigation. It generates a detailed HTML diagnostics report containing app and OS versions, device and storage details, session information, and system or debug logs. The report can be attached when users submit feedback, reducing back-and-forth and helping developers analyze issues; the article also notes support for agentic development.

### Source excerpt

A user diagnostics report that helps you solve bugs and improve user support at the same time. I've been writing apps since 2009, and the Diagnostics repository is an outcome of all that experience. Used by major apps from companies like WeTransfer, it has proven its value time after time. I've seen consistent inefficiency at ... -> The post User Diagnostics Reports: Solving app bugs faster with AI Agents appeared first on SwiftLee.

## Defer in Swift explained with Code Examples

DevFeed: [Defer in Swift explained with Code Examples](<https://devfeed.tech/articles/defer-in-swift-explained-with-code-examples-11485.md>)

Original publisher: [Read original article](<https://www.avanderlee.com/swift/defer-usage-swift/>)

Author: Antoine van der Lee

Published: 2026-07-06T12:51:59Z

Content type: tutorial

Language: en

Sources: [SwiftLee](<https://devfeed.tech/sources/swiftlee.md>)

Topics: [Swift](<https://devfeed.tech/topics/swift.md>), [Code](<https://devfeed.tech/topics/code.md>), [async/await](<https://devfeed.tech/topics/async-await.md>), [Concurrency](<https://devfeed.tech/topics/concurrency.md>)

Tags: [code](<https://devfeed.tech/tags/code.md>), [concurrency](<https://devfeed.tech/tags/concurrency.md>), [defer](<https://devfeed.tech/tags/defer.md>), [examples](<https://devfeed.tech/tags/examples.md>), [leaving](<https://devfeed.tech/tags/leaving.md>), [scope](<https://devfeed.tech/tags/scope.md>), [swift](<https://devfeed.tech/tags/swift.md>)

### AI overview

This tutorial explains Swift's defer statement, which runs code when control leaves its scope. It covers reverse execution order for multiple defer statements, using defer for resource cleanup, and Swift 6.4 support for awaiting asynchronous cleanup in defer bodies.

### Source excerpt

Although the defer keyword was already introduced in Swift 2.0, it's still quite uncommon to use it in projects. Its usage can be hard to understand, but using it can improve your code a lot in some places. The most common use case seen around is opening and closing a context within a scope. Starting ... -> The post Defer in Swift explained with Code Examples appeared first on SwiftLee.