//
//  NXTextBubbleView.swift
//  bubbleLayer_swift
//
//  Created by liuming on 2020/8/23.
//  Copyright © 2020 liuming. All rights reserved.
//

import SnapKit
import UIKit

class NXTextBubbleView: NXNormalBubbleView {
    public let textLabel = UILabel(frame: .zero)

    override init(frame: CGRect) {
        super.init(frame: frame)
        initSubViews()
    }

    required init?(coder _: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    private func initSubViews() {
        containView.addSubview(textLabel)
        textLabel.snp.makeConstraints { make in
            make.edges.equalTo(UIEdgeInsets(top: 0, left: 5, bottom: 0, right: 5))
        }
    }

    // MARK: - 重写交互层的长按和点击事件

    override public func tapGestureRecognizerHandler(sender _: UITapGestureRecognizer) {
        print("点击了文字气泡")
    }

    override public func longGestureRecognizerHandler(sender _: UILongPressGestureRecognizer) {
        print("长按了 点击了文字气泡")
    }
}
