今天从网上看见这个功能,记录一下。
这个功能就是在App内,把一部分文字信息复制到粘贴板上
UIPasteboard *board = [UIPasteboard generalPasteboard];
NSString *boardString = [NSString stringWithFormat:@"www.baidu.com"];
[board setString:boardString];
if (board == nil) {
[[[UIAlertView alloc] initWithTitle:@"提示" message:@"复制失败" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil] show];
}
else {
[[[UIAlertView alloc] initWithTitle:@"提示" message:@"复制成功" delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil] show];
}
网友评论