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;
void UIKit_InitClipboard(_THIS)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
static SDL_VideoDevice * _this
void UIKit_QuitClipboard(_THIS)
int SDL_SendClipboardUpdate(void)
static char text[MAX_TEXT_LENGTH]
int UIKit_SetClipboardText(_THIS, const char *text)
char * UIKit_GetClipboardText(_THIS)
SDL_bool UIKit_HasClipboardText(_THIS)