ios 模拟点击复制功能
2022-11-25 本文已影响0人
wodeph
#pragma mark模拟点击复制
-(void)codeCopyBtnClick:(NSString*)copyStr{
NSLog(@"复制");
UIPasteboard *pab = [UIPasteboard generalPasteboard];
pab.string= copyStr;
if(pab ==nil) {//toastInView
[ALToastView toastInView:self.view withText:HDLocalizedString(@"复制失败")];
}else{
[ALToastView toastInView:self.view withText:HDLocalizedString(@"已复制")];
}
}