Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,15 @@ - (BOOL)canPerformAction:(SEL)action withSender:(id)sender
return [super canPerformAction:action withSender:sender];
}

// UIKit queries this when the keyboard becomes active, including when the app returns to the
// foreground. The default implementation calls `canPerformAction:` with `paste:`, which
// synchronously queries the system pasteboard on the main thread and can hang the app. TextInput
// only accepts text, so opt out of image paste; text paste is unaffected.
- (BOOL)supportsImagePaste
{
return NO;
}

- (void)buildMenuWithBuilder:(id<UIMenuBuilder>)builder
{
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 170000 && !TARGET_OS_TV
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,15 @@ - (BOOL)canPerformAction:(SEL)action withSender:(id)sender
return [super canPerformAction:action withSender:sender];
}

// UIKit queries this when the keyboard becomes active, including when the app returns to the
// foreground. The default implementation calls `canPerformAction:` with `paste:`, which
// synchronously queries the system pasteboard on the main thread and can hang the app. TextInput
// only accepts text, so opt out of image paste; text paste is unaffected.
- (BOOL)supportsImagePaste
{
return NO;
}

- (void)buildMenuWithBuilder:(id<UIMenuBuilder>)builder
{
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 170000
Expand Down
Loading