iOS アプリがあり、それをWindowsにしたい場合、AI ツールはマッピング作業のほとんどを実行できます。 このページでは、UIKit/SwiftUI から WinUI 3 への主要な概念の翻訳について説明します。 これらのテーブルは、AI エージェントにプロンプトを表示するときにコンテキストとして使用します。正確な API マッピングを前もって指定すると、汎用変換を要求するよりもはるかに正確な出力が生成されます。
最初に WinUI エージェント プラグイン をインストールして、エージェントに正確な WinUI 3 の知識を与えます。
gh copilot plugin install winui@awesome-copilot
概念マッピング
| iOS (UIKit/SwiftUI) | WinUI 3 に相当する | メモ |
|---|---|---|
UIViewController |
Page |
WinUI ページは、Frame を使用してナビゲートされます。 |
UINavigationController |
Frame + NavigationView |
ページ切り替えに Frame.Navigate() を使用する |
UITabBarController |
NavigationView (上または左のタブ) |
|
UITableView |
ListView |
データ バインディングに ObservableCollection<T> を使用する |
UICollectionView |
GridView |
|
UIAlertController |
ContentDialog |
現在の XamlRoot の親の子要素として配置する必要があります。 |
UILabel |
TextBlock |
|
UITextField |
TextBox |
|
UIButton |
Button |
|
UIImageView |
Image |
|
UIStackView |
StackPanel |
OrientationをHorizontalまたはVerticalに設定します |
Auto Layout |
Grid / StackPanel / RelativePanel |
XAML レイアウトは行/列ベース |
@State
/
@Binding (SwiftUI) |
INotifyPropertyChanged
/
ObservableProperty (CommunityToolkit.Mvvm) |
|
NSUserDefaults |
ApplicationData.Current.LocalSettings |
|
URLSession |
HttpClient |
System.Net.Http.HttpClient を使用する |
NotificationCenter |
イベントまたは WeakReferenceMessenger (CommunityToolkit.Mvvm) |
|
DispatchQueue.main.async |
DispatcherQueue.TryEnqueue |
|
AppDelegate.applicationDidFinishLaunching |
App.OnLaunched |
|
SceneDelegate / windowScene |
MainWindow / AppWindow |
|
FileManager |
StorageFolder / StorageFile |
|
UserNotifications |
AppNotificationManager (Microsoft.Windows。AppNotifications) |
スタート プロンプト
このプロンプトを使用して、移行を開始する前に必要なコンテキストを AI エージェントに提供します。
I'm migrating an iOS app to WinUI 3 using the Windows App SDK.
The app is written in [Swift / Objective-C] using [UIKit / SwiftUI].
Apply these mappings:
- UIViewController → Page, navigated via Frame
- UINavigationController → Frame + NavigationView
- UITableView → ListView with ObservableCollection<T>
- UIAlertController → ContentDialog (parented to XamlRoot)
- NSUserDefaults → ApplicationData.Current.LocalSettings
- URLSession → System.Net.Http.HttpClient
- DispatchQueue.main.async → DispatcherQueue.TryEnqueue
- @State / @Binding → INotifyPropertyChanged via CommunityToolkit.Mvvm
Use Microsoft.UI.Xaml.* namespaces throughout — never Windows.UI.Xaml.*.
Generate C# — not Swift.
直接マッピングされないもの
一部の iOS の概念には、直接 WinUI に相当するものがありません。
-
アプリ内購入: Microsoft Store commerce API を
Windows.Services.Store経由で使用します プッシュ通知 (APNs) :Windows プッシュ通知サービス (WNS) - HealthKit/ARKit/CoreML: Windowsには関連するテクノロジ領域 (Windows ML、 Windows Mixed Reality、および Windows Sensors — これらは直接的な同等のものではなく、プラットフォーム固有の実装が必要です
- アプリ クリップ: 直接同等の機能はありません。Web からアプリへのリンクを検討してください
関連するコンテンツ
GitHub で Microsoft と共同作業する
このコンテンツのソースは GitHub にあります。そこで、issue や pull request を作成および確認することもできます。 詳細については、共同作成者ガイドを参照してください。
Windows developer