-
Modernisez votre app UIKit
Découvrez les dernières mises à jour d'UIKit. Découvrez comment adapter la mise en page de votre app iPhone pour qu'elle fonctionne parfaitement lorsqu'elle est redimensionnée avec la recopie iPhone et sur iPad. Explorez les nouvelles API pour les barres d'onglets et de navigation, apprenez à préparer votre app pour les nouvelles fonctionnalités d'Apple Intelligence et découvrez une compétence pour l'agent de codage de votre choix qui vous aidera à moderniser votre code de base.
Chapitres
- 0:00 - Introduction
- 0:34 - Adaptabilité des apps
- 2:10 - API héritée : Cycle de vie de l’app
- 2:51 - API héritée : Écran principal
- 5:46 - Mode plein écran pour les jeux
- 6:17 - API héritée : Idiome de l’interface utilisateur
- 7:55 - Protocoles Body d’UIView pour le mouvement et la localisation
- 8:19 - Tester votre app iPhone redimensionnable
- 9:18 - Barres d’onglets et barres latérales
- 10:52 - Barres de navigation
- 12:37 - Menus
- 13:01 - Intégration avec Apple Intelligence
- 14:07 - Codage agentique
- 15:32 - Étapes suivantes
Ressources
- TN3208: Preparing your app’s launch screen to meet App Store requirements
- TN3210: Optimizing your app for iPhone Mirroring
- Make your UIKit app more flexible
- Adapting your app when traits change
- Transitioning to the UIKit scene-based life cycle
- Automatic trait tracking
- Human Interface Guidelines: Menus
Vidéos connexes
WWDC26
- Explorez les fonctionnalités avancées d’App Intents pour Siri et Apple Intelligence
- Tirez le meilleur parti de Device Hub
WWDC25
WWDC24
-
Rechercher dans cette vidéo…
-
-
3:24 - Use local screen references
// Use local screen references // Access the correct screen through a windowScene let screen = window?.windowScene?.screen // Pass in local screen references func generateThumbnail(_ image: UIImage, screen: UIScreen) -> UIImage { // existing code, replacing main screen with local screen reference // ... } -
3:49 - Replace screen scale with displayScale
// Replace the screen's scale with trait collection's displayScale override func layoutSubviews() { super.layoutSubviews() // layoutSubviews will be called again automatically when displayScale changes let displayScale = traitCollection.displayScale // ... } -
4:36 - Register for trait changes
// Manually register for trait changes let displayScaleTrait: [UITrait] = [UITraitDisplayScale.self] registerForTraitChanges(displayScaleTrait) { (view: GalleryView, previousTraitCollection: UITraitCollection) in view.cache.invalidate() } -
5:19 - Monitor effective geometry changes
// UIWindowSceneDelegate func windowScene( _ windowScene: UIWindowScene, didUpdateEffectiveGeometry previousEffectiveGeometry: UIWindowScene.Geometry ) { let geometry = windowScene.effectiveGeometry let availableSpace = geometry.coordinateSpace.bounds // ... } -
5:35 - Check available space using view bounds
// Checking available space override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() let availableSpace = view.bounds.size // ... } -
8:12 - Configure motion and location body
// Configure motion and heading bodies override func viewDidLoad() { super.viewDidLoad() motionManager.deviceMotionBody = view locationManager.headingBody = view } -
9:51 - Opt into sidebar layout
tabBarController.sidebar.preferredPlacement = .sidebar -
10:22 - Check sidebar availability
tabBarController.sidebar.isAvailable -
10:53 - Set prominent tab identifier
// Set the prominent tab let tabs = [ // ... ] let tabBarController = UITabBarController(tabs: tabs) tabBarController.prominentTabIdentifier = "cart" -
11:30 - Customize bar minimization behavior
// Customize bar minimization behavior override init( nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle? ) { super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) navigationItem.barMinimizationBehavior = .always navigationItem.barMinimizationSafeAreaAdjustment = .never } -
15:05 - Export Xcode skills for use in other tools
xcrun agent skills export
-