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
 

Videos

Abrir menú Cerrar menú
  • Colecciones
  • Todos los videos
  • Información

Más videos

  • Información
  • Código
  • Keep up with the keyboard

    Each year, the keyboard evolves to support an increasing range of languages, sizes, and features. Discover how you can design your app to keep up with the keyboard, regardless of how it appears on a device. We'll show you how to create frictionless text entry and share important architectural changes to help you understand how the keyboard works within the system.

    Capítulos

    • 0:00 - Introduction
    • 1:29 - Out of process keyboard
    • 3:47 - Design for the keyboard
    • 14:06 - New text entry APIs
    • 15:06 - Key takeaways

    Recursos

    • Adding a search interface to your app
    • FocusState
    • SafeAreaRegions
    • Human Interface Guidelines: Keyboards
    • Adjusting your layout with keyboard layout guide
      • Video HD
      • Video SD

    Videos relacionados

    WWDC23

    • What’s new with text and text interactions

    WWDC21

    • Your guide to keyboard layout
  • Buscar este video…
    • 6:21 - Keyboard layout guide

      view.keyboardLayoutGuide.topAnchor.constraint(equalTo: textView.bottomAnchor).isActive = true
    • 7:56 - usesBottomSafeArea

      // Example of using usesBottomSafeArea to create keyboard and text view aligned with safe area
      
      view.keyboardLayoutGuide.usesBottomSafeArea = false
      
      textField.topAnchor.constraint(equalToSystemSpacingBelow: backdrop.topAnchor, multiplier: 1.0).isActive = true
      
      view.keyboardLayoutGuide.topAnchor.constraint(greaterThanOrEqualToSystemSpacingBelow: textField.bottomAnchor, multiplier: 1.0).isActive = true
      
      view.keyboardLayoutGuide.topAnchor.constraint(equalTo: backdrop.bottomAnchor).isActive = true
      
      view.safeAreaLayoutGuide.bottomAnchor.constraint(greaterThanOrEqualTo: textField.bottomAnchor).isActive = true
    • 9:40 - Keyboard dismiss padding

      var dismissPadding = aboveKeyboardView.bounds.size.height
      
      view.keyboardLayoutGuide.keyboardDismissPadding = dismissPadding
    • 12:11 - Handle willShow or hideKeyboard notifications

      func handleWillShowOrHideKeyboardNotification(notification: NSNotification) {
          // Retrieve the UIScreen object from the notification (Added iOS 16.1)
          guard let screen = notification.object as? UIScreen else { return }
      
          // Determine if the notification’s screen corresponds to your view’s screen
          guard(screen.isEqual(view.window?.screen)) else { return }
      
          // Calculate intersection with keyboard
          let endFrameKey = UIResponder.keyboardFrameEndUserInfoKey
      
          // Get the ending screen position of the keyboard
          guard let keyboardFrameEnd = userInfo[endFrameKey] as? CGRect else { return }
      
          let fromCoordinateSpace: UICoordinateSpace = screen.coordinateSpace
          let toCoordinateSpace: UICoordinateSpace = view
      
          // Convert from the screen coordinate space to your local coordinate space
          let convertedKeyboardFrameEnd = fromCoordinateSpace.convert(keyboardFrameEnd, to: toCoordinateSpace)
      
          // Calculate offset for view adjustment
          var bottomOffset = view.safeAreaInsets.bottom
                  
          // Get the intersection between the keyboard's frame and the view's bounds
          let viewIntersection = view.bounds.intersection(convertedKeyboardFrameEnd)
                  
          // Check whether the keyboard intersects your view before adjusting your offset.
          if !viewIntersection.isEmpty {
              // Set the offset to the height of the intersection
              bottomOffset = viewIntersection.size.height
          }
      
          // Use the new offset to adjust your UI
          movingBottomConstraint.constant = bottomOffset
        
          // Adjust view layouts and animate using information in notification
        
          ...
        
      }
    • 14:38 - Inline predictions

      @MainActor public protocol UITextInputTraits : NSObjectProtocol {
          // Controls whether inline text prediction is enabled or disabled during typing
          @available(iOS, introduced: 17.0)
          optional var inlinePredictionType: UITextInlinePredictionType { get set }
      }
      
      public enum UITextInlinePredictionType : Int, @unchecked Sendable {
          case `default` = 0
          case no = 1
          case yes = 2
      }
      
      let textView = UITextView(frame: frame)
      textView.inlinePredictionType = .yes

Developer Footer

  • Videos
  • WWDC23
  • Keep up with the keyboard
  • 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