1 复制文字到剪贴板UIPasteboard
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"订单追踪" message:@"点击物流信息即复制" delegate:self cancelButtonTitle:@"关闭" otherButtonTitles: nil];
alertView.delegate = self;
[alertView addButtonWithTitle:[NSString stringWithFormat:@"物流公司名称:%@", _orderDetailModel.DeliveryCompanyName]];
[alertView addButtonWithTitle:[NSString stringWithFormat:@"订单号:%@", _orderDetailModel.DeliveryCode]];
[alertView show];
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{
if (buttonIndex == 1 || buttonIndex == 2) {
//剪贴板类UIPasteboard
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
[pasteboard setString:[alertView buttonTitleAtIndex:buttonIndex]];
}
}