 import UIKit
 import YYText
 
-class TopicDetailCommentCell: UITableViewCell ,V2CommentAttachmentImageTapDelegate , V2PhotoBrowserDelegate{
+class TopicDetailCommentCell: UITableViewCell{
     /// 头像
     var avatarImageView: UIImageView?
     /// 用户名

        self.avatarImageView!.addGestureRecognizer(userNameTap)
        userNameTap = UITapGestureRecognizer(target: self, action: #selector(TopicDetailCommentCell.userNameTap(_:)))
        self.userNameLabel!.addGestureRecognizer(userNameTap)
    }
    func userNameTap(sender:UITapGestureRecognizer) {
        if let _ = self.itemModel , username = itemModel?.userName {

    }
}

//MARK: - 长按复制功能
extension TopicDetailCommentCell {
    func longPressHandle(longPress:UILongPressGestureRecognizer) -> Void {
        if (longPress.state == .Began) {
            self.becomeFirstResponder()
            
            let item = UIMenuItem(title: "复制", action: #selector(TopicDetailCommentCell.copyText))
            
            let menuController = UIMenuController.sharedMenuController()
            menuController.menuItems = [item]
            menuController.arrowDirection = .Down
            menuController.setTargetRect(self.frame, inView: self.superview!)
            menuController.setMenuVisible(true, animated: true);
        }
        
    }
    override func canPerformAction(action: Selector, withSender sender: AnyObject?) -> Bool {
        if (action == #selector(TopicDetailCommentCell.copyText)){
            return true
        }
        return super.canPerformAction(action, withSender: sender);
    }
    override func canBecomeFirstResponder() -> Bool {
        return true
    }
    
    func copyText() -> Void {
        UIPasteboard.generalPasteboard().string = self.itemModel?.textLayout?.text.string
    }
}
