Observação
O acesso a essa página exige autorização. Você pode tentar entrar ou alterar diretórios.
O acesso a essa página exige autorização. Você pode tentar alterar os diretórios.
Se você tiver um aplicativo iOS e quiser trazê-lo para Windows, as ferramentas de IA poderão fazer a maior parte do trabalho de mapeamento. Esta página fornece as principais traduções de conceito do UIKit/SwiftUI para o WinUI 3. Use essas tabelas como contexto ao solicitar o agente de IA – fornecer mapeamentos exatos de API antecipadamente produz uma saída muito mais precisa do que solicitar uma conversão genérica.
Instale o plug-in do agente WinUI primeiro para fornecer ao agente conhecimento preciso do WinUI 3:
gh copilot plugin install winui@awesome-copilot
Mapeamento de conceito
| iOS (UIKit / SwiftUI) | WinUI 3 equivalente | Notes |
|---|---|---|
UIViewController |
Page |
As páginas winUI são navegadas por meio de Frame |
UINavigationController |
Frame + NavigationView |
Usar Frame.Navigate() para transições de página |
UITabBarController |
NavigationView (guias superior ou esquerda) |
|
UITableView |
ListView |
Usar ObservableCollection<T> para associação de dados |
UICollectionView |
GridView |
|
UIAlertController |
ContentDialog |
Deve ter como pai o XamlRoot atual |
UILabel |
TextBlock |
|
UITextField |
TextBox |
|
UIButton |
Button |
|
UIImageView |
Image |
|
UIStackView |
StackPanel |
Definir Orientation como Horizontal ou Vertical |
Auto Layout |
Grid / StackPanel / RelativePanel |
O layout XAML é baseado em linha/coluna |
@State
/
@Binding (SwiftUI) |
INotifyPropertyChanged
/
ObservableProperty (CommunityToolkit.Mvvm) |
|
NSUserDefaults |
ApplicationData.Current.LocalSettings |
|
URLSession |
HttpClient |
Utilize System.Net.Http.HttpClient |
NotificationCenter |
Eventos ou WeakReferenceMessenger (CommunityToolkit.Mvvm) |
|
DispatchQueue.main.async |
DispatcherQueue.TryEnqueue |
|
AppDelegate.applicationDidFinishLaunching |
App.OnLaunched |
|
SceneDelegate / windowScene |
MainWindow / AppWindow |
|
FileManager |
StorageFolder / StorageFile |
|
UserNotifications |
AppNotificationManager (Microsoft.Windows.AppNotifications) |
Prompt de início
Use este prompt para dar ao agente de IA o contexto necessário antes de iniciar uma migração:
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.
O que não é mapeado diretamente
Alguns conceitos do iOS não têm um WinUI equivalente direto:
-
Compras no aplicativo: Use as APIs de comércio da Microsoft Store via
Windows.Services.Store - Notificações por push (APNs): Use Windows Push Notification Services (WNS)
- HealthKit/ARKit/CoreML: Windows tem áreas de tecnologia relacionadas — Windows ML, Windows Mixed Reality e Windows Sensors — mas não são equivalentes diretos e exigem implementação específica da plataforma
- App Clips: Nenhum equivalente direto — considere vinculação da web ao app
Conteúdo relacionado
Windows developer