Copy functionality in iOS by using UIPasteboard

前端 未结 5 733
清歌不尽
清歌不尽 2021-02-02 06:04
 NSString *copyStringverse = [[NSString alloc] initWithFormat:@"%@",[textview.text]];
 UIPasteboard *pb = [UIPasteboard generalPasteboard];
 [pb setString:copy         


        
5条回答
  •  灰色年华
    2021-02-02 06:36

    For Swift 2.1+:

    let cell = tableView.cellForRowAtIndexPath(indexPath) as! UITableViewCell // change this to your custom cell if you use one
    UIPasteboard.generalPasteboard().string = cell.textLabel.text
    

提交回复
热议问题