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
 

Vidéos

Ouvrir le menu Fermer le menu
  • Collections
  • Toutes les vidéos
  • À propos

Plus de vidéos

  • À propos
  • Code
  • Support Full Keyboard Access in your iOS app

    iPhone and iPad support numerous input modes for those with motor impairments, including touch interaction modification, Switch Control, and Full Keyboard Access. We'll explore how people can interact with their devices solely through keyboard input, working through a real-life example to discover key APIs. We'll also take you through some best practices for supporting motor accessibility when you integrate Full Keyboard Access in your apps.

    Ressources

    • Accessibility for Developers
      • Vidéo HD
      • Vidéo SD

    Vidéos connexes

    WWDC22

    • What's new in web accessibility

    WWDC21

    • Direct and reflect focus in SwiftUI
    • Focus on iPad keyboard navigation
  • Rechercher dans cette vidéo…
    • 7:06 - Accessibility custom actions

      // Accessibility custom actions
      
      let addAction = UIAccessibilityCustomAction(
          name: gameLocString("add"), image: UIImage(systemName: "plus.square")) { _ in
                  self.addCard()
                  return true
              }
              
      let pinAction = UIAccessibilityCustomAction(
          name: gameLocString("pin"), image: UIImage(systemName: "pin.fill")) { _ in
                  self.pinCard()
                  return true
              }
              
      cardView.accessibilityCustomActions = [addAction, pinAction]
    • 8:39 - Keyboard shortcuts: buildMenu

      // Keyboard shortcuts
      
      // In AppDelegate.swift
      override func buildMenu(with builder: UIMenuBuilder) {
          super.buildMenu(with: builder)
          guard builder.system == .main else {
              return
          }
              
          let pinCommand = UIKeyCommand(title: gameLocString("pin"), image: UIImage(systemName:
              "pin.fill"), action:#selector(GameViewController.pinFocusedCard), input: "P",
              discoverabilityTitle:gameLocString("pin.card"))      
          let addCommand = UIKeyCommand(title: gameLocString("add"), image: UIImage(systemName: 
              "plus.square"), action: #selector(GameViewController.addFocusedCard), input: "A",
              discoverabilityTitle: gameLocString("add.card"))
          let identifier = UIMenu.Identifier("gameplay_menu")
          let menu = UIMenu.init(title: gameLocString("gameplay"), image:  UIImage(systemName
              "rectangle.grid.3x2"), identifier: identifier, children: [addCommand, pinCommand]);
              
          builder.insertSibling(menu, afterMenu: .view)
      }
    • 9:22 - Keyboard shortcuts: canPerformAction

      // Keyboard shortcuts
      
      // In GameViewController.swift
      override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
          if action == #selector(addFocusedCard) || action == #selector(pinFocusedCard) {
              return self.focusedCard != .none
          }
          return super.canPerformAction(action, withSender: sender)
      }
    • 10:35 - Accessibility elements

      itemView.isAccessibilityElement = true
      itemView.accessibilityLabel = gameLocString(for: item)
    • 11:01 - Responding to user interaction

      itemView.accessibilityRespondsToUserInteraction = false
    • 13:41 - Supporting accessible input

      self.accessibilityUserInputLabels = [
          gameLocString("settings"),
          gameLocString("prefs"),
          gameLocString("preferences"),
          gameLocString("gear")];
    • 14:52 - Accessibility path

      // Accessibility path
      
      let rect = circleLevelButton.convert(levelButton.bounds, to: nil)
      
      circleLevelButton.accessibilityPath = UIBezierPath(ovalIn: rect)
      
      
      // If your button is in a scroll view, it’s generally better to
      // override accessibilityPath and/or accessibilityFrame
      extension CircleButton {
          open override var accessibilityPath: UIBezierPath? {
              get {
                  let rect = self.convert(self.bounds, to: nil)
                  return UIBezierPath(ovalIn: rect)
              }
              set {
                  // no-op
              }
          }
      }

Developer Footer

  • Vidéos
  • WWDC21
  • Support Full Keyboard Access in your iOS 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