SuperAPI AI Directory

swift-ios-migration

General & other

View repository

Updated 10-16 09:56

About this skill

Swift/iOS Migration Guide

A guide for migrating existing code and handling breaking changes accompanying version upgrades.

Directory Structure

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ウィンドウシステム

Reference Files

references/ios17-observable.md

Guide to migrating to the iOS 17+ @Observable macro:

  • Migration Patterns: ObservableObject → @Observable
  • @Bindable: Alternatives to @Published/@Binding
  • @Environment Changes: New ways to pass environment values
  • Performance Improvements: Per-property observation
  • Notes: Compatibility, coexistence with existing code

references/swift6-concurrency.md

Swift 6 Concurrency Support Guide:

  • @MainActor: Application to the entire ViewModel, UI protection
  • Sendable: Data model design, actor boundaries
  • Migration Checklist: Enabling Strict Concurrency Checking
  • Common Warnings and Solutions:
    • "Non-sendable type captured"
    • "Actor-isolated property cannot be mutated"
  • Actor: Guaranteeing thread safety with custom Actors

references/swift62-changes.md

Swift 6.2 / Xcode 26 Migration Guide:

  • Approachable Concurrency: More approachable concurrency
  • Default Actor Isolation: Making MainActor the default
  • @concurrent: Explicit background execution
  • New Xcode 26 Features: AI Coding Tools, Playground enhancements
  • Debugging Improvements: LLDB enhancements, concurrency debugging

references/ipados26-windowing.md

iPadOS 26 Window System Migration Guide:

  • Deprecation of UIRequiresFullScreen: Removal from Info.plist, Auto Layout support
  • Scene Geometry: UIWindowScene.Geometry, effectiveGeometry, resize detection
  • Size Restrictions: UISceneSizeRestrictions, minimumSize/maximumSize settings
  • Orientation Lock: prefersInterfaceOrientationLocked, orientation change monitoring
  • Menu Bar Support: SwiftUI Commands, UIMenuBuilder, keyboard shortcuts
  • Multi-window: UIApplicationSupportsMultipleScenes, creating new windows
  • Trait Collection: Size class support, automatic tracking

Usage

When migrating to iOS 17 @Observable

  1. references/ios17-observable.mdcheck the migration patterns with
  2. Start using@Observablein new code
  3. Migrate gradually starting from small existing ViewModels
  4. Migrate large ViewModels with caution

When migrating to Swift 6

  1. references/swift6-concurrency.mdcheck the checklist with
  2. Enable Strict Concurrency Checking
  3. ViewModelに@MainActorAdd
  4. Make the data modelSendablecompatible with
  5. Resolve warnings one by one

When migrating to Swift 6.2

  1. references/swift62-changes.mdcheck the new features with
  2. Update to Xcode 26
  3. Enable Approachable Concurrency
  4. Set Default Actor Isolation to MainActor
  5. Where necessary,@concurrentadd
  6. Simplify existing Swift 6 code

When supporting the iPadOS 26 window system

  1. references/ipados26-windowing.mdCheck the migration checklist with
  2. UIRequiresFullScreenRemove from Info.plist
  3. Implement size-adaptive layout with Auto Layout
  4. UISceneSizeRestrictionsSet the minimum size with
  5. Menu bar support (when using an external keyboard)

Migration priority

Swift 6.2 (recommended order)

  1. Enable Approachable Concurrency in Build Settings
  2. Set Default Actor Isolation to MainActor
  3. Add@concurrentwhere necessary
  4. Simplify existing Swift 6 code

Swift 6 (recommended order)

  1. ViewModelに@MainActorAdd
  2. Make the data modelSendablecompatible with
  3. Unify asynchronous processingasync/awaitto

iOS 17 @Observable (recommended order)

  1. Use@Observablein new code
  2. Migrate from small existing ViewModels
  3. Migrate large ViewModels carefully

iPadOS 26 (recommended order)

  1. Build and test with Xcode 26
  2. Remove UIRequiresFullScreen
  3. Verify Auto Layout support
  4. Implement the menu bar

Version compatibility table

Feature Swift 5.9 Swift 6 Swift 6.2
Strict Concurrency Opt-in Default Default
@MainActor ✅ ✅ ✅
Default Actor Isolation - - ✅
@concurrent - - ✅
Approachable Concurrency - - ✅
Feature iOS 16 iOS 17 iOS 18 iOS 26
@Observable - ✅ ✅ ✅
iPadOS new window system - - - ✅

Related skills

  • swiftui-components: UI component catalog
  • swiftui-coding-guidelines: Basic best practices
  • swiftui-ssot: State management design
  • swiftui-accessibility: Accessibility implementation