复制功能的实现

#pragma mark - copyCodeMethod

- (void)copyMethod:(UIButton *)button {
   
    if (button.tag == 7000) {
        UIPasteboard *pboard = [UIPasteboard generalPasteboard];
        pboard.string = content.text;
        NSLog(@"%@", pboard.string);
    }
   
    UIView *bigView = (UIView *)button.superview;
   
    for (int i = 0; i < self.codeArray.count - 1; i++) {
        if (button.tag == 5000 + i) {
            UILabel *conten = (UILabel *)[bigView viewWithTag:6000 + i];
                
                NSLog(@"%@", pboard.string);
           
        }
    }
}
原文地址:https://www.cnblogs.com/tian-sun/p/5019991.html