Shared SwiftUI App Workflow
БесплатноБез исполняемых скриптовНе проверенEnd-to-end Xcode workflow for architecting, debugging, profiling, and shipping a shared SwiftUI app on iOS and macOS.
Об этом скилле
Instructions
- Overview: This workflow outlines best practices to build, test, and deploy a SwiftUI app targeting both iOS and macOS (with an option for Catalyst). It covers project setup, architecture choices, development practices, and continuous delivery steps.
- Prerequisites: Ensure you have the latest Xcode installed (Xcode 15 or newer) and are enrolled in the Apple Developer Program (required for code signing, Xcode Cloud, and TestFlight). Familiarity with SwiftUI, Git source control, and basic iOS/macOS app development is assumed.
- Usage: Follow the steps below in sequence to configure a multi-platform Xcode project, manage dependencies, implement an architecture (MVVM or TCA), debug and profile efficiently, set up CI/CD pipelines, and finally distribute the app via TestFlight.
- Conventions: This guide uses bold titles for key actions and italics for tool names or concepts. Replace example placeholders (like bundle identifiers or scheme names) with your own project-specific values when applying these steps.
Workflow
Create a Multiplatform Xcode Project: Begin by creating a new Xcode project that supports both iOS and macOS targets. Xcode 14+ offers a Multiplatform App template, which sets up a single target capable of building for iOS (and iPadOS) and macOS using SwiftUI. This unified target shares most code and assets across platforms. If you prefer separate targets, you can instead create an iOS app and then add a macOS target (or enable Mac Catalyst for the iOS target). Ensure that shared code (like SwiftUI views and models) is grouped in a cross-platform group, and use platform checks (
#if os(iOS),#if os(macOS)) for any platform-specific code. By structuring the project as a shared codebase, you minimize duplication while still tailoring the UI where necessary for each device type.Set Up Targets, Schemes, and Configurations: With a multi-platform project, Xcode may already include separate configurations for Debug and Release. You might add custom Build Configurations (e.g. Staging or QA) if needed. If using separate targets (for Catalyst or environment flavors), give each target a unique Bundle Identifier and Info.plist. For example, suffix the bundle ID with ".mac" for a macOS target or ".dev" for a development build. Create corresponding Schemes for each app target or environment so you can easily run and archive each version. Mark schemes as "Shared" to include them in source control (important for team use and CI). This multi-target setup allows you to, for instance, have an iOS app, a native macOS app, and even a Catalyst app all in one project, each with its own scheme and bundle ID.
Configure Environment Settings: Manage environment-specific settings by using Xcode's build configuration options. For example, you can define custom XCConfig files or use User-Defined Build Settings for values like API endpoints or feature flags. Define keys in Info.plist that reference these settings. For instance, add a key for
BaseURLin your Info.plist and assign it a value like$(BASE_URL)which is set per configuration. In Build Settings, create a user-defined variableBASE_URLfor each configuration (e.g. Dev, QA, Prod), each pointing to the appropriate URL. Your app can read these at runtime, for example:
let apiURL = Bundle.main.object(forInfoDictionaryKey: "BaseURL") as? String
This way, you avoid hardcoding environment values. Additionally,
consider using Compiler Flags for conditional code. In each
configuration's build settings, you might add Swift flags like
-DDEVELOPMENT or -DPRODUCTION. Then in Swift code, use
#if DEVELOPMENT to include debug-only logic or use placeholders for
testing. This approach keeps configuration differences isolated at build
time. Finally, ensure each app target uses distinct app icons and names
if needed (e.g. add suffix "Dev" to the app name for a development
build) -- you can set this via Info.plist or Asset catalogs per target.
- Manage Dependencies (SPM and CocoaPods): Use Swift Package
Manager (SPM) as the primary tool for adding libraries and
frameworks. SPM is built into Xcode, making dependency management
seamless for SwiftUI projects. To add a package, go to File ▸ Add
Packages... and enter the package Git URL. Target the dependency
to your app target (and not to any CocoaPods-generated target) so
the package integrates correctly. SPM automatically fetches and
updates packages and keeps them sandboxed within Xcode. Commit the
Package.resolvedfile so that team members and CI use the same versions. If you need a library that isn't available via SPM (or contains significant Objective-C/legacy code), you can integrate
Установить Shared SwiftUI App Workflow в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл Shared SwiftUI App Workflow?
End-to-end Xcode workflow for architecting, debugging, profiling, and shipping a shared SwiftUI app on iOS and macOS.
Как установить скилл Shared SwiftUI App Workflow?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл Shared SwiftUI App Workflow запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic