swift UITableViewCell拷贝

来源:互联网 发布:淘宝宝贝限时打折 编辑:程序博客网 时间:2024/06/05 06:29
    func tableView(tableView: UITableView, performAction action: Selector, forRowAtIndexPath indexPath: NSIndexPath, withSender sender: AnyObject?) {        if action == Selector("copy:") {            if let cell = tableView.cellForRowAtIndexPath(indexPath) as? JokeViewCell {                UIPasteboard.generalPasteboard().string = cell.contentLabel.text            }        }    }    func tableView(tableView: UITableView, canPerformAction action: Selector, forRowAtIndexPath indexPath: NSIndexPath, withSender sender: AnyObject?) -> Bool {        return action == Selector("copy:")    }    func tableView(tableView: UITableView, shouldShowMenuForRowAtIndexPath indexPath: NSIndexPath) -> Bool {        return true    }
0 0
原创粉丝点击