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
  • Adopt desktop-class editing interactions

    Discover advanced desktop-class editing features that can help people accelerate their productivity in your app. Learn how you can provide more interactions inline with your UI to help people quickly access editing features and make your iPadOS app feel right at home on macOS with Mac Catalyst. We'll also explore the highly-customizable find interaction and learn how the system UI can help people consistently find content in your app.

    Recursos

    • UIFindInteraction
    • UIEditMenuInteraction
    • Building a desktop-class iPad app
    • Supporting desktop-class features in your iPad app
      • Video HD
      • Video SD

    Videos relacionados

    WWDC22

    • Build a desktop-class iPad app
    • Meet desktop-class iPad
    • What's new in UIKit

    WWDC19

    • Modernizing Your UI for iOS 13
    • Taking iPad Apps for Mac to the Next Level
  • Buscar este video…
    • 2:42 - Adding items into text edit menus

      func textView(
          _ textView: UITextView, 
          editMenuForTextIn range: NSRange, 
          suggestedActions: [UIMenuElement]) -> UIMenu?
    • 4:03 - Adding actions into a text view's menu

      func textView(
          _ textView: UITextView,
          editMenuForTextIn range: NSRange,
          suggestedActions: [UIMenuElement]
      ) -> UIMenu? {
          var additionalActions: [UIMenuElement] = []
          if range.length > 0 {
              let highlightAction = UIAction(title: "Highlight", ...)
              additionalActions.append(highlightAction)
          }
          let insertPhotoAction = UIAction(title: "Insert Photo", ...)
          additionalActions.append(insertPhotoAction)
          return UIMenu(children: suggestedActions + additionalActions)
      }
    • 5:24 - Presenting an edit menu with a custom gesture

      let editMenuInteraction = UIEditMenuInteraction(delegate: self)
      view.addInteraction(editMenuInteraction)
      
      let tapRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTap(_:)))
      tapRecognizer.allowedTouchTypes = [UITouch.TouchType.direct.rawValue as NSNumber]
      view.addGestureRecognizer(tapRecognizer)
      
      @objc func didTap(_ recognizer: UITapGestureRecognizer) {
          let location = recognizer.location(in: self.view)
          if self.hasSelectedObjectView(at: location) {
              let configuration = UIEditMenuConfiguration(identifier: nil, sourcePoint: location)
              editMenuInteraction.presentEditMenu(with: configuration)
          }
      }
    • 7:13 - Implementing UIEditMenuInteractionDelegate

      func editMenuInteraction(
          _ interaction: UIEditMenuInteraction,
          targetRectFor configuration: UIEditMenuConfiguration
      ) -> CGRect {
          guard let selectedView = objectView(at: configuration.sourcePoint) else { return .null }
          return selectedView.frame
      }
      
      func editMenuInteraction(
          _ interaction: UIEditMenuInteraction,
          menuFor configuration: UIEditMenuConfiguration,
          suggestedActions: [UIMenuElement]
      ) -> UIMenu? {
          let duplicateAction = UIAction(title: "Duplicate") { ... }
          return UIMenu(children: suggestedActions + [duplicateAction])
      }
    • 10:34 - Using the "keeps menu presented" attribute

      UIAction(title: "Increase",
               image: UIImage(systemName: "increase.indent"),
               attributes: .keepsMenuPresented) { ... }
      
      UIAction(title: "Decrease",
               image: UIImage(systemName: "decrease.indent"),
               attributes: .keepsMenuPresented) { ... }
    • 12:46 - Find with system views

      open var findInteraction: UIFindInteraction? { get }
      textView.isFindInteractionEnabled = true
    • 17:22 - Installing a UIFindInteraction on a custom view

      let customDocument = MyDocument(string: "")
      lazy var customView = MyTextView(document: customDocument)
      
      lazy var findInteraction = UIFindInteraction(sessionDelegate: self)
      
      override var canBecomeFirstResponder: Bool { true }
      
      override func viewDidLoad() {
          customView.addInteraction(findInteraction)
      }
      
      func findInteraction(_ interaction: UIFindInteraction, sessionFor view: UIView) -> UIFindSession? {
          return UITextSearchingFindSession(searchableObject: customDocument)
      }

Developer Footer

  • Videos
  • WWDC22
  • Adopt desktop-class editing interactions
  • 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