21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_UIKIT
26 #include "../../events/SDL_clipboardevents_c.h"
28 #import <UIKit/UIPasteboard.h>
34 return SDL_SetError(
"The clipboard is not available on tvOS");
37 [UIPasteboard generalPasteboard].string = @(
text);
50 UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
51 NSString *
string = pasteboard.string;
67 if ([UIPasteboard generalPasteboard].
string != nil) {
81 NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
83 id observer = [center addObserverForName:UIPasteboardChangedNotification
86 usingBlock:^(NSNotification *note) {
90 data.pasteboardObserver = observer;
101 if (
data.pasteboardObserver != nil) {
102 [[NSNotificationCenter defaultCenter] removeObserver:data.pasteboardObserver];
105 data.pasteboardObserver = nil;