View in English

  • Apple Developer
    • Get Started

    Explore Get Started

    • Overview
    • Learn
    • Apple Developer Program

    Stay Updated

    • Latest News
    • Hello Developer
    • Platforms

    Explore Platforms

    • Apple Platforms
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store

    Featured

    • Design
    • Distribution
    • Games
    • Accessories
    • Web
    • Home
    • CarPlay
    • Technologies

    Explore Technologies

    • Overview
    • Xcode
    • Swift
    • SwiftUI

    Featured

    • Accessibility
    • App Intents
    • Apple Intelligence
    • Games
    • Machine Learning & AI
    • Security
    • Xcode Cloud
    • Community

    Explore Community

    • Overview
    • Meet with Apple events
    • Community-driven events
    • Developer Forums
    • Open Source

    Featured

    • WWDC
    • Swift Student Challenge
    • Developer Stories
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Centers
    • Documentation

    Explore Documentation

    • Documentation Library
    • Technology Overviews
    • Sample Code
    • Human Interface Guidelines
    • Videos

    Release Notes

    • Featured Updates
    • iOS
    • iPadOS
    • macOS
    • watchOS
    • visionOS
    • tvOS
    • Xcode
    • Downloads

    Explore Downloads

    • All Downloads
    • Operating Systems
    • Applications
    • Design Resources

    Featured

    • Xcode
    • TestFlight
    • Fonts
    • SF Symbols
    • Icon Composer
    • Support

    Explore Support

    • Overview
    • Help Guides
    • Developer Forums
    • Feedback Assistant
    • Contact Us

    Featured

    • Account Help
    • App Review Guidelines
    • App Store Connect Help
    • Upcoming Requirements
    • Agreements and Guidelines
    • System Status
  • Quick Links

    • Events
    • News
    • Forums
    • Sample Code
    • Videos
 

Vídeos

Abrir menu Fechar menu
  • Coleções
  • Todos os vídeos
  • Sobre

Mais vídeos

  • Sobre
  • Código
  • Build a desktop-class iPad app

    Discover how you can create iPad apps that take advantage of desktop class features. Join Mohammed from the UIKit team as we explore the latest navigation, collection view, menu, and editing APIs and learn best practices for building powerful iPad apps. Code along with this session in real time or download our sample app to use as a reference for updating your own code.

    Recursos

    • collectionView(_:performPrimaryActionForItemAt:)
    • titleMenuProvider
    • UINavigationItem.ItemStyle
    • collectionView(_:contextMenuConfigurationForItemsAt:point:)
    • centerItemGroups
    • UINavigationItemRenameDelegate
    • UIDocumentProperties
    • Building a desktop-class iPad app
    • Supporting desktop-class features in your iPad app
      • Vídeo HD
      • Vídeo SD

    Vídeos relacionados

    WWDC23

    • Build better document-based apps

    WWDC22

    • Adopt desktop-class editing interactions
    • Bring your iOS app to the Mac
    • Meet desktop-class iPad
    • What's new in UIKit
    • What’s new in iPad app design
    • WWDC22 Day 3 recap
  • Buscar neste vídeo...
    • 3:36 - Enable UINavigationBar editor style.

      navigationItem.style = .editor
    • 3:52 - Set a back action.

      navigationItem.backAction = UIAction(…)
    • 4:48 - Create a document properties header.

      let properties = UIDocumentProperties(url: document.fileURL)
      
      if let itemProvider = NSItemProvider(contentsOf: document.fileURL) {
          properties.dragItemsProvider = { _ in
              [UIDragItem(itemProvider: itemProvider)]
          }
          properties.activityViewControllerProvider = {
              UIActivityViewController(activityItems: [itemProvider], applicationActivities: nil)
          }
      }
      
      navigationItem.documentProperties = properties
    • 6:36 - Adopt rename title menu action and rename UI

      override func viewDidLoad() {
          navigationItem.renameDelegate = self
      }
      
      func navigationItem(_ navigationItem: UINavigationItem, didEndRenamingWith title: String) {
          // Rename document using methods appropriate to the app’s data model
      }
    • 7:09 - Adopt system provided title menu actions.

      override func duplicate(_ sender: Any?) {
          // Duplicate document
      }
      
      override func move(_ sender: Any?) {
          // Move document
      }
      
      func didOpenDocument() {
          ...
          navigationItem.titleMenuProvider = { [unowned self] suggested in
              var children = suggested
      
              ...
      
              return UIMenu(children: children)
          }
      }
    • 7:10 - Add custom title menu actions

      func didOpenDocument() {
          ...
          navigationItem.titleMenuProvider = { [unowned self] suggested in
              var children = suggested
              children += [
                  UIMenu(title: "Export…", 
                         image: UIImage(systemName: "arrow.up.forward.square"), 
                         children: [
                      UIAction(title: "HTML", image: UIImage(systemName: "safari")) { ... },
                      UIAction(title: "PDF", image: UIImage(systemName: "doc")) { ... }
                  ])
              ]
              return UIMenu(children: children)
          }
      }
    • 9:35 - Enable customization for center items

      navigationItem.customizationIdentifier = "editorView"
    • 10:00 - Define a fixed center item group.

      UIBarButtonItem(title: "Sync Scrolling", ...).creatingFixedGroup()
    • 10:23 - Define an optional (customizable) center item group.

      UIBarButtonItem(title: "Add Link", ...).creatingOptionalGroup(customizationIdentifier: "addLink")
    • 10:56 - Define a non-default optional center item group.

      UIBarButtonItemGroup.optionalGroup(customizationIdentifier: "textFormat",
      																	 isInDefaultCustomization: false,
      																	 representativeItem: UIBarButtonItem(title: "Format", ...)
      																	 items: [
      																	      UIBarButtonItem(title: "Bold", ...),
      																	      UIBarButtonItem(title: "Italics", ...),
      																	      UIBarButtonItem(title: "Underline", ...),
      																	 ])
    • 13:16 - Define a custom menu representation for a bar button item group.

      sliderGroup.menuRepresentation = UIMenu(title: "Text Size",
                                              preferredElementSize: .small,
                                              children: [
          UIAction(title: "Decrease",
                   image: UIImage(systemName: "minus.magnifyingglass"),
                   attributes: .keepsMenuPresented) { ... },
          UIAction(title: "Reset",
                   image: UIImage(systemName: "1.magnifyingglass"),
                   attributes: .keepsMenuPresented) { ... },
          UIAction(title: "Increase",
                   image: UIImage(systemName: "plus.magnifyingglass"),
                   attributes: .keepsMenuPresented) { ... },
      ])
    • 15:10 - Enable multiple selection and keyboard focus in a UICollectionView.

      // Enable multiple selection
      collectionView.allowsMultipleSelection = true
      
      // Enable keyboard focus
      collectionView.allowsFocus = true
      
      // Allow keyboard focus to drive selection 
      collectionView.selectionFollowsFocus = true
    • 16:11 - Add a primary action to UICollectionView items.

      func collectionView(_ collectionView: UICollectionView, 
                          performPrimaryActionForItemAt indexPath: IndexPath) {
        
          // Scroll to the tapped element
          if let element = dataSource.itemIdentifier(for: indexPath) {
              delegate?.outline(self, didChoose: element)
          }
      }
    • 16:56 - Add a multi-item menu to UICollectionView.

      func collectionView(_ collectionView: UICollectionView, 
                            contextMenuConfigurationForItemsAt indexPaths: [IndexPath], 
                            point: CGPoint) -> UIContextMenuConfiguration? {
      
          if indexPaths.count == 0 {
              // Construct an empty space menu
          } 
          else if indexPaths.count == 1 {
              // Construct a single item menu
          } 
          else {
              // Construct a multi-item menu
          }
      }
    • 18:12 - Enable Find and Replace in UITextView.

      textView.isFindInteractionEnabled = true
    • 18:34 - Add custom actions to UITextView's edit menu.

      func textView(_ textView: UITextView,
                    editMenuForTextIn range: NSRange,
                    suggestedActions: [UIMenuElement]) -> UIMenu? {
          
          if textView.selectedRange.length > 0 {
              let customActions = [ UIAction(title: "Hide", ... ) { ... } ]
              return UIMenu(children: customActions + suggestedActions)
          }
          
          return nil
      }

Developer Footer

  • Vídeos
  • WWDC22
  • Build a desktop-class iPad app
  • Open Menu Close Menu
    • iOS
    • iPadOS
    • macOS
    • tvOS
    • visionOS
    • watchOS
    • App Store
    Open Menu Close Menu
    • Swift
    • SwiftUI
    • Swift Playground
    • TestFlight
    • Xcode
    • Xcode Cloud
    • Icon Composer
    • SF Symbols
    Open Menu Close Menu
    • Accessibility
    • Accessories
    • Apple Intelligence
    • Audio & Video
    • Augmented Reality
    • Business
    • Design
    • Distribution
    • Education
    • Games
    • Health & Fitness
    • In-App Purchase
    • Localization
    • Maps & Location
    • Machine Learning & AI
    • Security
    • Safari & Web
    Open Menu Close Menu
    • Documentation
    • Downloads
    • Sample Code
    • Videos
    Open Menu Close Menu
    • Help Guides & Articles
    • Contact Us
    • Forums
    • Feedback & Bug Reporting
    • System Status
    Open Menu Close Menu
    • Apple Developer
    • App Store Connect
    • Certificates, IDs, & Profiles
    • Feedback Assistant
    Open Menu Close Menu
    • Apple Developer Program
    • Apple Developer Enterprise Program
    • App Store Small Business Program
    • MFi Program
    • Mini Apps Partner Program
    • News Partner Program
    • Video Partner Program
    • Security Bounty Program
    • Security Research Device Program
    Open Menu Close Menu
    • Meet with Apple
    • Apple Developer Centers
    • App Store Awards
    • Apple Design Awards
    • Apple Developer Academies
    • WWDC
    Read the latest news.
    Get the Apple Developer app.
    Copyright © 2026 Apple Inc. All rights reserved.
    Terms of Use Privacy Policy Agreements and Guidelines