Answers:
尽管可以接受的答案很好地介绍了UIPasteboard
工作原理,但我认为为了方便大家,我将在此处发布相关代码段:
OBJ-C
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
pasteboard.string = @"paste me somewhere";
斯威夫特2.2
let pasteBoard = UIPasteboard.generalPasteboard()
pasteBoard.string = "Paste Me !"
迅捷3+:
let pasteBoard = UIPasteboard.general
pasteBoard.string = "Paste me!"