EditingMenuItem

public struct EditingMenuItem

A single item in an editing menu.

  • The type of menu item.

    Declaration

    Swift

    public var kind: Kind
  • A callback, invoked when the user selects the menu item.

    Declaration

    Swift

    public var onSelect: () -> Void
  • Creates a new menu item of the given kind.

    Declaration

    Swift

    public init(
        title: String,
        onSelect: @escaping () -> Void
    )
  • Creates a new menu item of the given kind.

    Declaration

    Swift

    public init(
        _ kind: Kind.System,
        onSelect: @escaping () -> Void
    )
  • A .copy type item, which will copy the given string to the provided pasteboard.

    Declaration

    Swift

    public static func copying(_ string: String, to pasteboard: UIPasteboard? = .general) -> EditingMenuItem
  • A .copy type item, which will copy the given image to the provided pasteboard.

    Declaration

    Swift

    public static func copying(_ image: UIImage, to pasteboard: UIPasteboard? = .general) -> EditingMenuItem
  • A .copy type item, which will copy the given url to the provided pasteboard.

    Declaration

    Swift

    public static func copying(_ url: URL, to pasteboard: UIPasteboard? = .general) -> EditingMenuItem
  • The menu item types you may place into a menu.

    See more

    Declaration

    Swift

    public enum Kind : Equatable