One Logo Pool Ball
UIKit · IOS API REFERENCE

UIPasteboard

class · iOS 3.0+ · SDK 27.1

class UIPasteboard

Members (74)

get

changedNotification

TypeScript
static get changedNotification(): _Foundation_NSNotification_Name
Swift declaration
nonisolated class let changedNotification: NSNotification.Name
get

changedTypesAddedUserInfoKey

TypeScript
static get changedTypesAddedUserInfoKey(): string
Swift declaration
nonisolated class let changedTypesAddedUserInfoKey: String
get

changedTypesRemovedUserInfoKey

TypeScript
static get changedTypesRemovedUserInfoKey(): string
Swift declaration
nonisolated class let changedTypesRemovedUserInfoKey: String
get

removedNotification

TypeScript
static get removedNotification(): _Foundation_NSNotification_Name
Swift declaration
nonisolated class let removedNotification: NSNotification.Name
get · iOS 10.0+

typeAutomatic

TypeScript
static get typeAutomatic(): string
Swift declaration
class let typeAutomatic: String
get

typeListColor

TypeScript
static get typeListColor(): _Foundation_NSArray
Swift declaration
class var typeListColor: NSArray
set

typeListColor

TypeScript
static set typeListColor(value: _Foundation_NSArray)
Swift declaration
class var typeListColor: NSArray
get

typeListImage

TypeScript
static get typeListImage(): _Foundation_NSArray
Swift declaration
class var typeListImage: NSArray
set

typeListImage

TypeScript
static set typeListImage(value: _Foundation_NSArray)
Swift declaration
class var typeListImage: NSArray
get

typeListString

TypeScript
static get typeListString(): _Foundation_NSArray
Swift declaration
class var typeListString: NSArray
set

typeListString

TypeScript
static set typeListString(value: _Foundation_NSArray)
Swift declaration
class var typeListString: NSArray
get

typeListURL

TypeScript
static get typeListURL(): _Foundation_NSArray
Swift declaration
class var typeListURL: NSArray
set

typeListURL

TypeScript
static set typeListURL(value: _Foundation_NSArray)
Swift declaration
class var typeListURL: NSArray
init · iOS 3.0+

init

TypeScript
static init(pasteboardName: UIPasteboard_Name, create: boolean): (UIPasteboard) | null
Swift declaration
init?(name pasteboardName: UIPasteboard.Name, create: Bool)
static · iOS 3.0+

withUniqueName

TypeScript
static withUniqueName(): UIPasteboard
Swift declaration
class func withUniqueName() -> UIPasteboard
static · iOS 3.0+

remove

TypeScript
static remove(pasteboardName: UIPasteboard_Name): void
Swift declaration
class func remove(withName pasteboardName: UIPasteboard.Name)
get · iOS 3.0+

general

TypeScript
static get general(): UIPasteboard
Swift declaration
class var general: UIPasteboard { get }
method · iOS 3.0+

addItems

TypeScript
addItems(items: Array<Record<string, unknown>>): void
Swift declaration
func addItems(_ items: [[String : Any]])
method · iOS 3.0+

contains

TypeScript
containsPasteboardTypes(pasteboardTypes: Array<string>): boolean
Swift declaration
func contains(pasteboardTypes: [String]) -> Bool
method · iOS 3.0+

contains

TypeScript
containsPasteboardTypesInItemSet(pasteboardTypes: Array<string>, itemSet?: (_Foundation_IndexSet) | null): boolean
Swift declaration
func contains(pasteboardTypes: [String], inItemSet itemSet: IndexSet?) -> Bool
method · iOS 3.0+

data

TypeScript
dataForPasteboardType(pasteboardType: string): (ArrayBuffer) | null
Swift declaration
func data(forPasteboardType pasteboardType: String) -> Data?
method · iOS 3.0+

data

TypeScript
dataForPasteboardTypeInItemSet(pasteboardType: string, itemSet?: (_Foundation_IndexSet) | null): (Array<ArrayBuffer>) | null
Swift declaration
func data(forPasteboardType pasteboardType: String, inItemSet itemSet: IndexSet?) -> [Data]?
method · iOS 3.0+

itemSet

TypeScript
itemSet(pasteboardTypes: Array<string>): (_Foundation_IndexSet) | null
Swift declaration
func itemSet(withPasteboardTypes pasteboardTypes: [String]) -> IndexSet?
method · iOS 3.0+

types

TypeScript
typesForItemSet(itemSet?: (_Foundation_IndexSet) | null): (Array<Array<string>>) | null
Swift declaration
func types(forItemSet itemSet: IndexSet?) -> [[String]]?
method · iOS 3.0+

setData

TypeScript
setData(data: ArrayBuffer, pasteboardType: string): void
Swift declaration
func setData(_ data: Data, forPasteboardType pasteboardType: String)
method · iOS 11.0+

setItemProviders

TypeScript
setItemProviders(itemProviders: Array<_Foundation_NSItemProvider>, localOnly: boolean, expirationDate?: (globalThis.Date) | null): void
Swift declaration
func setItemProviders(_ itemProviders: [NSItemProvider], localOnly: Bool, expirationDate: Date?)
method · iOS 10.0+

setItems

TypeScript
setItems(items: Array<Record<string, unknown>>, options?: NativeMap<UIPasteboard_OptionsKey, unknown>): void
Swift declaration
func setItems(_ items: [[String : Any]], options: [UIPasteboard.OptionsKey : Any] = [:])
method · iOS 11.0+

setObjects

TypeScript
setObjects(objects: Array<SDKHandle>): void
Swift declaration
func setObjects(_ objects: [any NSItemProviderWriting])
method · iOS 11.0+

setObjects

TypeScript
setObjectsLocalOnlyExpirationDate(objects: Array<SDKHandle>, localOnly: boolean, expirationDate?: (globalThis.Date) | null): void
Swift declaration
func setObjects(_ objects: [any NSItemProviderWriting], localOnly: Bool, expirationDate: Date?)
method · iOS 3.0+ · Deprecated in iOS 10.0

setPersistent

TypeScript
setPersistent(persistent: boolean): void
Swift declaration
func setPersistent(_ persistent: Bool)
method · iOS 3.0+

setValue

TypeScript
setValue(value: unknown, pasteboardType: string): void
Swift declaration
func setValue(_ value: Any, forPasteboardType pasteboardType: String)
method · iOS 3.0+

value

TypeScript
value(pasteboardType: string): (unknown) | null
Swift declaration
func value(forPasteboardType pasteboardType: String) -> Any?
method · iOS 3.0+

values

TypeScript
values(pasteboardType: string, itemSet?: (_Foundation_IndexSet) | null): (Array<unknown>) | null
Swift declaration
func values(forPasteboardType pasteboardType: String, inItemSet itemSet: IndexSet?) -> [Any]?
get · iOS 3.0+

url

TypeScript
get url(): (string) | null
Swift declaration
var url: URL? { get set }
set · iOS 3.0+

url

TypeScript
set url(value: (string) | null)
Swift declaration
var url: URL? { get set }
get · iOS 3.0+

urls

TypeScript
get urls(): (Array<string>) | null
Swift declaration
var urls: [URL]? { get set }
set · iOS 3.0+

urls

TypeScript
set urls(value: (Array<string>) | null)
Swift declaration
var urls: [URL]? { get set }
get · iOS 3.0+

changeCount

TypeScript
get changeCount(): number
Swift declaration
var changeCount: Int { get }
get · iOS 3.0+

color

TypeScript
get color(): (UIColor) | null
Swift declaration
@NSCopying var color: UIColor? { get set }
set · iOS 3.0+

color

TypeScript
set color(value: (UIColor) | null)
Swift declaration
@NSCopying var color: UIColor? { get set }
get · iOS 3.0+

colors

TypeScript
get colors(): (Array<UIColor>) | null
Swift declaration
var colors: [UIColor]? { get set }
set · iOS 3.0+

colors

TypeScript
set colors(value: (Array<UIColor>) | null)
Swift declaration
var colors: [UIColor]? { get set }
get · iOS 10.0+

hasColors

TypeScript
get hasColors(): boolean
Swift declaration
var hasColors: Bool { get }
get · iOS 10.0+

hasImages

TypeScript
get hasImages(): boolean
Swift declaration
var hasImages: Bool { get }
get · iOS 10.0+

hasStrings

TypeScript
get hasStrings(): boolean
Swift declaration
var hasStrings: Bool { get }
get · iOS 10.0+

hasURLs

TypeScript
get hasURLs(): boolean
Swift declaration
var hasURLs: Bool { get }
get · iOS 3.0+

image

TypeScript
get image(): (UIImage) | null
Swift declaration
@NSCopying var image: UIImage? { get set }
set · iOS 3.0+

image

TypeScript
set image(value: (UIImage) | null)
Swift declaration
@NSCopying var image: UIImage? { get set }
get · iOS 3.0+

images

TypeScript
get images(): (Array<UIImage>) | null
Swift declaration
var images: [UIImage]? { get set }
set · iOS 3.0+

images

TypeScript
set images(value: (Array<UIImage>) | null)
Swift declaration
var images: [UIImage]? { get set }
get · iOS 11.0+

itemProviders

TypeScript
get itemProviders(): Array<_Foundation_NSItemProvider>
Swift declaration
var itemProviders: [NSItemProvider] { get set }
set · iOS 11.0+

itemProviders

TypeScript
set itemProviders(value: Array<_Foundation_NSItemProvider>)
Swift declaration
var itemProviders: [NSItemProvider] { get set }
get · iOS 3.0+

items

TypeScript
get items(): Array<Record<string, unknown>>
Swift declaration
var items: [[String : Any]] { get set }
set · iOS 3.0+

items

TypeScript
set items(value: Array<Record<string, unknown>>)
Swift declaration
var items: [[String : Any]] { get set }
get · iOS 3.0+

name

TypeScript
get name(): UIPasteboard_Name
Swift declaration
var name: UIPasteboard.Name { get }
get · iOS 3.0+

numberOfItems

TypeScript
get numberOfItems(): number
Swift declaration
var numberOfItems: Int { get }
get · iOS 3.0+

types

TypeScript
get types(): Array<string>
Swift declaration
var types: [String] { get }
get · iOS 3.0+

isPersistent

TypeScript
get isPersistent(): boolean
Swift declaration
var isPersistent: Bool { get }
get · iOS 3.0+

string

TypeScript
get string(): (string) | null
Swift declaration
var string: String? { get set }
set · iOS 3.0+

string

TypeScript
set string(value: (string) | null)
Swift declaration
var string: String? { get set }
get · iOS 3.0+

strings

TypeScript
get strings(): (Array<string>) | null
Swift declaration
var strings: [String]? { get set }
set · iOS 3.0+

strings

TypeScript
set strings(value: (Array<string>) | null)
Swift declaration
var strings: [String]? { get set }
method · iOS 14.0+ · Deprecated in iOS 15.0

detectValues

TypeScript
detectValuesForCompletionHandler(patterns: Array<UIPasteboard_DetectionPattern>, completionHandler: ((arg0: SDKHandle) => void)): void
Swift declaration
func detectValues(for patterns: Set<UIPasteboard.DetectionPattern>, completionHandler: @escaping (Result<[UIPasteboard.DetectionPattern : Any], any Error>) -> ())
method · iOS 15.0+

detectValues

TypeScript
detectValuesForCompletionHandler15120(keyPaths: Array<"patterns" | "probableWebURL" | "probableWebSearch" | "number" | "links" | "phoneNumbers" | "emailAddresses" | "postalAddresses" | "calendarEvents" | "shipmentTrackingNumbers" | "flightNumbers" | "moneyAmounts" | SDKHandle>, completionHandler: ((arg0: SDKHandle) => void)): void
Swift declaration
func detectValues(for keyPaths: Set<PartialKeyPath<UIPasteboard.DetectedValues>>, completionHandler: @escaping (Result<UIPasteboard.DetectedValues, any Error>) -> ())
method · iOS 14.0+ · Deprecated in iOS 15.0

detectValues

TypeScript
detectValuesForInItemSetCompletionHandler(patterns: Array<UIPasteboard_DetectionPattern>, itemSet: (_Foundation_IndexSet) | null, completionHandler: ((arg0: SDKHandle) => void)): void
Swift declaration
func detectValues(for patterns: Set<UIPasteboard.DetectionPattern>, inItemSet itemSet: IndexSet?, completionHandler: @escaping (Result<[[UIPasteboard.DetectionPattern : Any]], any Error>) -> ())
method · iOS 15.0+

detectValues

TypeScript
detectValuesForInItemSetCompletionHandler13355(keyPaths: Array<"patterns" | "probableWebURL" | "probableWebSearch" | "number" | "links" | "phoneNumbers" | "emailAddresses" | "postalAddresses" | "calendarEvents" | "shipmentTrackingNumbers" | "flightNumbers" | "moneyAmounts" | SDKHandle>, itemSet: (_Foundation_IndexSet) | null, completionHandler: ((arg0: SDKHandle) => void)): void
Swift declaration
func detectValues(for keyPaths: Set<PartialKeyPath<UIPasteboard.DetectedValues>>, inItemSet itemSet: IndexSet?, completionHandler: @escaping (Result<[UIPasteboard.DetectedValues], any Error>) -> ())
method · iOS 14.0+ · Deprecated in iOS 15.0

detectPatterns

TypeScript
detectPatternsForCompletionHandler(patterns: Array<UIPasteboard_DetectionPattern>, completionHandler: ((arg0: SDKHandle) => void)): void
Swift declaration
func detectPatterns(for patterns: Set<UIPasteboard.DetectionPattern>, completionHandler: @escaping (Result<Set<UIPasteboard.DetectionPattern>, any Error>) -> ())
method · iOS 15.0+

detectPatterns

TypeScript
detectPatternsForCompletionHandler82474(keyPaths: Array<"patterns" | "probableWebURL" | "probableWebSearch" | "number" | "links" | "phoneNumbers" | "emailAddresses" | "postalAddresses" | "calendarEvents" | "shipmentTrackingNumbers" | "flightNumbers" | "moneyAmounts" | SDKHandle>, completionHandler: ((arg0: SDKHandle) => void)): void
Swift declaration
func detectPatterns(for keyPaths: Set<PartialKeyPath<UIPasteboard.DetectedValues>>, completionHandler: @escaping (Result<Set<PartialKeyPath<UIPasteboard.DetectedValues>>, any Error>) -> ())
method · iOS 14.0+ · Deprecated in iOS 15.0

detectPatterns

TypeScript
detectPatternsForInItemSetCompletionHandler(patterns: Array<UIPasteboard_DetectionPattern>, itemSet: (_Foundation_IndexSet) | null, completionHandler: ((arg0: SDKHandle) => void)): void
Swift declaration
func detectPatterns(for patterns: Set<UIPasteboard.DetectionPattern>, inItemSet itemSet: IndexSet?, completionHandler: @escaping (Result<[Set<UIPasteboard.DetectionPattern>], any Error>) -> ())
method · iOS 15.0+

detectPatterns

TypeScript
detectPatternsForInItemSetCompletionHandler88741(keyPaths: Array<"patterns" | "probableWebURL" | "probableWebSearch" | "number" | "links" | "phoneNumbers" | "emailAddresses" | "postalAddresses" | "calendarEvents" | "shipmentTrackingNumbers" | "flightNumbers" | "moneyAmounts" | SDKHandle>, itemSet: (_Foundation_IndexSet) | null, completionHandler: ((arg0: SDKHandle) => void)): void
Swift declaration
func detectPatterns(for keyPaths: Set<PartialKeyPath<UIPasteboard.DetectedValues>>, inItemSet itemSet: IndexSet?, completionHandler: @escaping (Result<[Set<PartialKeyPath<UIPasteboard.DetectedValues>>], any Error>) -> ())
method · iOS 15.0+

detectedValues

TypeScript
detectedValuesForInItemSet(keyPaths: Array<"patterns" | "probableWebURL" | "probableWebSearch" | "number" | "links" | "phoneNumbers" | "emailAddresses" | "postalAddresses" | "calendarEvents" | "shipmentTrackingNumbers" | "flightNumbers" | "moneyAmounts" | SDKHandle>, itemSet?: (_Foundation_IndexSet) | null): Promise<Array<UIPasteboard_DetectedValues>>
Swift declaration
func detectedValues(for keyPaths: Set<PartialKeyPath<UIPasteboard.DetectedValues>>, inItemSet itemSet: IndexSet?) async throws -> [UIPasteboard.DetectedValues]
method · iOS 15.0+

detectedValues

TypeScript
detectedValuesFor(keyPaths: Array<"patterns" | "probableWebURL" | "probableWebSearch" | "number" | "links" | "phoneNumbers" | "emailAddresses" | "postalAddresses" | "calendarEvents" | "shipmentTrackingNumbers" | "flightNumbers" | "moneyAmounts" | SDKHandle>): Promise<UIPasteboard_DetectedValues>
Swift declaration
func detectedValues(for keyPaths: Set<PartialKeyPath<UIPasteboard.DetectedValues>>) async throws -> UIPasteboard.DetectedValues
method · iOS 15.0+

detectedPatterns

TypeScript
detectedPatternsForInItemSet(keyPaths: Array<"patterns" | "probableWebURL" | "probableWebSearch" | "number" | "links" | "phoneNumbers" | "emailAddresses" | "postalAddresses" | "calendarEvents" | "shipmentTrackingNumbers" | "flightNumbers" | "moneyAmounts" | SDKHandle>, itemSet?: (_Foundation_IndexSet) | null): Promise<Array<Array<"patterns" | "probableWebURL" | "probableWebSearch" | "number" | "links" | "phoneNumbers" | "emailAddresses" | "postalAddresses" | "calendarEvents" | "shipmentTrackingNumbers" | "flightNumbers" | "moneyAmounts" | SDKHandle>>>
Swift declaration
func detectedPatterns(for keyPaths: Set<PartialKeyPath<UIPasteboard.DetectedValues>>, inItemSet itemSet: IndexSet?) async throws -> [Set<PartialKeyPath<UIPasteboard.DetectedValues>>]
method · iOS 15.0+

detectedPatterns

TypeScript
detectedPatternsFor(keyPaths: Array<"patterns" | "probableWebURL" | "probableWebSearch" | "number" | "links" | "phoneNumbers" | "emailAddresses" | "postalAddresses" | "calendarEvents" | "shipmentTrackingNumbers" | "flightNumbers" | "moneyAmounts" | SDKHandle>): Promise<Array<"patterns" | "probableWebURL" | "probableWebSearch" | "number" | "links" | "phoneNumbers" | "emailAddresses" | "postalAddresses" | "calendarEvents" | "shipmentTrackingNumbers" | "flightNumbers" | "moneyAmounts" | SDKHandle>>
Swift declaration
func detectedPatterns(for keyPaths: Set<PartialKeyPath<UIPasteboard.DetectedValues>>) async throws -> Set<PartialKeyPath<UIPasteboard.DetectedValues>>

Skipped declarations

3 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

UIPasteboard.setObjects(_:)

This declaration needs Swift generic type arguments. (no canonical witness for T)

UIPasteboard.setObjects(_:localOnly:expirationDate:)

This declaration needs Swift generic type arguments. (no canonical witness for T)

UIPasteboard.init()

inherited init: cannot prove legal (class declares 1 custom initializer)

All UIKit types →