| name | swift-ios-migration |
| description | Migration guide for Swift and iOS. Use when migrating ObservableObject to @Observable (iOS 17), enabling Swift 6/6.2 Strict Concurrency, fixing @MainActor/Sendable warnings, adopting Approachable Concurrency (Swift 6.2), or handling iPadOS 26 windowing system changes (UIRequiresFullScreen deprecation). Covers breaking changes and version upgrade tasks. |
Swift/iOS マイグレーションガイド
既存コードの移行作業やバージョンアップに伴う破壊的変更への対応ガイド。
ディレクトリ構成
swift-ios-migration/
├── SKILL.md (このファイル)
└── references/
├── ios17-observable.md # @Observable移行パターン
├── swift6-concurrency.md # Swift 6並行処理対応
├── swift62-changes.md # Swift 6.2 / Xcode 26
└── ipados26-windowing.md # iPadOS 26ウィンドウシステム
リファレンスファイル
references/ios17-observable.md
iOS 17+ @Observableマクロへの移行ガイド:
- 移行パターン: ObservableObject → @Observable
- @Bindable: @Published/@Bindingの代替
- @Environment変更: 環境値の新しい渡し方
- パフォーマンス向上: プロパティ単位の監視
- 注意点: 互換性、既存コードとの共存
references/swift6-concurrency.md
Swift 6並行処理対応ガイド:
- @MainActor: ViewModel全体への適用、UI保護
- Sendable: データモデル設計、アクター境界
- 移行チェックリスト: Strict Concurrency Checking有効化
- よくある警告と解決策:
- "Non-sendable type captured"
- "Actor-isolated property cannot be mutated"
- Actor: カスタムActorでスレッドセーフ保証
references/swift62-changes.md
Swift 6.2 / Xcode 26 移行ガイド:
- Approachable Concurrency: より使いやすい並行処理
- Default Actor Isolation: MainActorをデフォルトに
- @concurrent: 明示的なバックグラウンド実行