ios复制到剪贴板

UIPasteboard 这个就是剪贴板

UIPasteboard * pastboard = [UIPasteboard generalPasteboard];

pastboard.string = self.scanResult;

[LCAlert toastShow:@"扫描结果已复制到剪贴板"];

常用方法:

/*通过名称获取粘贴板并且移除*/
+ (void)removePasteboardWithName:(NSString *)pasteboardName;
/*从粘贴板中获取数据,pasteboardType是自定义的,说明app可以处理哪种类型的数据*/
- (nullable NSData *)dataForPasteboardType:(NSString *)pasteboardType;
/*data类型的数据放在粘贴板中,pasteboardType同上*/
- (void)setData:(NSData *)data forPasteboardType:(NSString *)pasteboardType;
/*从粘贴板中取出data*/
- (nullable NSData *)dataForPasteboardType:(NSString *)pasteboardType;
上一篇:SQL 2008提供几种数据同步方式


下一篇:SQLite与MySQL、SQLServer等异构数据库之间的数据同步