Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将字符串复制到 iOS 的剪贴板上?我在文档中搜索了“剪贴板”,但没有找到任何结果。
像这样:
[UIPasteboard generalPasteboard].string = @"hello!";
Apple 不使用“剪贴板”一词;在 iOS 中,它是一个“粘贴板”,您可以拥有多个。
在Swift 3.0下面的代码中将有助于复制文本PasteBoard
Swift 3.0
PasteBoard
let pasteBoard = UIPasteboard.general pasteBoard.string = "Lorem Ipsum"