본문으로 건너뛰기
cccskills
무료GitHub에 공개

migration-patterns

Migration guides for CoreData to SwiftData, UIKit to SwiftUI, ObservableObject to @Observable, XCTest to Swift Testing, Objective-C to Swift, and StoreKit 1 to StoreKit 2. Use when migrating between Apple framework generations.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(7)

  • SKILL.md6.5 KB
  • coredata-to-swiftdata.md12.9 KB
  • objc-to-swift.md16.6 KB
  • observable-migration.md12.7 KB
  • storekit-migration.md18.8 KB
  • uikit-to-swiftui.md16.8 KB
  • xctest-to-swift-testing.md14.1 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Migration Patterns

Comprehensive guides for migrating between Apple framework generations. Each guide covers the full before/after mapping, coexistence strategies, and common pitfalls.

When This Skill Activates

  • User asks how to migrate from CoreData to SwiftData
  • User is moving UIKit code to SwiftUI (or embedding one in the other)
  • User needs to update from ObservableObject/Combine to @Observable/AsyncSequence
  • User is converting XCTest tests to Swift Testing
  • User asks about coexistence strategies (running old and new frameworks side by side)
  • User wants to know whether a migration is worth doing for their situation
  • User is migrating Objective-C code to Swift (bridging headers, incremental migration)
  • User is migrating from StoreKit 1 to StoreKit 2 (in-app purchases, subscriptions)
  • User encounters errors during a framework migration

Decision Tree

What are you migrating?
|
+-- Data persistence layer
|   +-- CoreData --> SwiftData
|   |   See coredata-to-swiftdata.md
|   |   Min: iOS 17 / macOS 14
|   |
|   +-- Still need CoreData features SwiftData lacks?
|       Stay on CoreData or use coexistence mode
|
+-- UI framework
|   +-- UIKit --> SwiftUI
|   |   See uikit-to-swiftui.md
|   |   Min: iOS 13 (basic), iOS 16+ (modern navigation)
|   |
|   +-- Full rewrite or incremental?
|       Incremental is almost always better -- adopt screen by screen
|
+-- State management / observation
|   +-- ObservableObject --> @Observable
|   |   See observable-migration.md
|   |   Min: iOS 17 / macOS 14
|   |
|   +-- Combine publishers --> AsyncSequence
|       Also covered in observable-migration.md
|
+-- Programming language
|   +-- Objective-C --> Swift
|   |   See objc-to-swift.md
|   |   Incremental: migrate leaves first, trunks last
|   |
|   +-- Mixed-language project?
|       Both languages coexist via bridging headers
|
+-- In-app purchases
|   +-- StoreKit 1 --> StoreKit 2
|   |   See storekit-migration.md
|   |   Min: iOS 15
|   |
|   +-- Using a third-party SDK (RevenueCat, etc.)?
|       Check if SDK already supports StoreKit 2 internally
|
+-- Testing framework
    +-- XCTest --> Swift Testing
        See xctest-to-swift-testing.md
        Min: Xcode 16 / Swift 6.0

Quick Reference

MigrationReference FileMinimum OSRisk Level
CoreData to SwiftDatacoredata-to-swiftdata.mdiOS 17 / macOS 14High (data layer)
UIKit to SwiftUIuikit-to-swiftui.mdiOS 13+Medium (incremental)
ObservableObject to @Observableobservable-migration.mdiOS 17 / macOS 14Low-Medium
Objective-C to Swiftobjc-to-swift.mdAnyMedium (incremental)
StoreKit 1 to StoreKit 2storekit-migration.mdiOS 15Medium-High (payments)
XCTest to Swift Testingxctest-to-swift-testing.mdXcode 16Low

Process

1. Assess the Migration

Before starting, determine:

  • What is the minimum deployment target? Many migrations require iOS 17+.
  • How large is the surface area? (number of models, screens, test files)
  • Can you adopt incrementally or is it all-or-nothing?
  • Are there third-party dependencies that assume the old framework?

2. Load Relevant Reference File

Based on the migration type, read from this directory:

  • coredata-to-swiftdata.md -- NSManagedObject to @Model, migration stages, coexistence
  • uikit-to-swiftui.md -- UIHostingController, Representable, incremental adoption
  • observable-migration.md -- @Observable macro, @Environment injection, AsyncSequence
  • objc-to-swift.md -- Bridging headers, @objc, incremental file-by-file migration
  • storekit-migration.md -- StoreKit 2 async/await purchases, Transaction.currentEntitlements, JWS
  • xctest-to-swift-testing.md -- @Test, #expect, #require, parameterized tests

3. Review the User's Code

Scan for old-framework patterns and map each to its modern equivalent using the reference file. Check for:

  • Deprecated API usage that has a direct modern replacement
  • Custom workarounds that are no longer needed with the new framework
  • Third-party dependencies that may conflict with the migration
  • Coexistence requirements (both frameworks running simultaneously)

4. Recommend a Migration Strategy

For each migration, decide between:

  • Full migration: Replace all old-framework code at once. Best for small codebases or when old framework is causing problems.
  • Incremental migration: Migrate piece by piece while both frameworks coexist. Best for large codebases, production apps, or when timeline is flexible.
  • No migration: The old framework is still appropriate. See "When NOT to Migrate" in each reference file.

General Migration Principles

  1. Migrate tests first. If you are migrating both app code and tests, migrate tests to Swift Testing first. This gives you a safety net for the app-code migration.

  2. One migration at a time. Do not migrate CoreData to SwiftData and ObservableObject to @Observable in the same PR. Each migration should be independently reviewable and revertible.

  3. Keep the old code compiling. During incremental migration, both old and new code must compile and run. Use coexistence patterns from each reference file.

  4. Feature-flag large migrations. For production apps, consider gating new-framework code behind a feature flag so you can roll back without a code revert.

  5. Write migration tests. For data-layer migrations (CoreData to SwiftData), write tests that verify data roundtrips correctly through both stacks.

References

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Run a structured accessibility audit on an iOS/macOS app — automated XCUITest audits, Accessibility Inspector, manual VoiceOver/Dynamic Type passes, and App Store Accessibility Nutrition Label evaluation. Use before release, when preparing Nutrition Label declarations, or for EU Accessibility Act compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rshankras/claude-code-apple-skills8132026년 7월 24일 업데이트

Generate accessibility infrastructure for VoiceOver, Dynamic Type, and accessibility features. Use when improving app accessibility, adding accessibility labels and hints, or auditing compliance.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rshankras/claude-code-apple-skills8132026년 7월 24일 업데이트

Generates an Apple-compliant account deletion flow with multi-step confirmation UI, optional data export, configurable grace period, Keychain cleanup, and server-side deletion request. Use when user needs account deletion, right-to-delete, or Apple App Review compliance for account removal.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rshankras/claude-code-apple-skills8132026년 7월 24일 업데이트

Privacy-preserving ad measurement with AdAttributionKit (SKAdNetwork's successor) — install and re-engagement attribution, conversion-value strategy under crowd anonymity, and end-to-end postback testing. Use when running paid acquisition beyond Apple Ads, measuring re-engagement campaigns, designing conversion values, or migrating from SKAdNetwork.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rshankras/claude-code-apple-skills8132026년 7월 24일 업데이트

alarmkit

무료

AlarmKit integration for scheduling alarms and timers with custom UI, Live Activities, and snooze support. Use when implementing alarm or timer features in iOS 26+ apps.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rshankras/claude-code-apple-skills8132026년 7월 24일 업데이트

Interpret app metrics and make data-driven decisions. Covers DAU/MAU, retention, LTV, ARPU, App Store Connect analytics, AARRR funnel analysis, cohort analysis, and diagnostic decision trees. Use when user wants to understand their metrics, diagnose problems, or build a data-driven growth plan.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

rshankras/claude-code-apple-skills8132026년 7월 24일 업데이트

rshankras의 스킬 모두 보기

이 스킬의 문제 신고