SwiftPopMenu icon indicating copy to clipboard operation
SwiftPopMenu copied to clipboard

发现几个问题,麻烦有时间修复下!

Open raisezhang opened this issue 9 years ago • 0 comments

1、不建议再 didSet 里面 initViews , 不看源码根本不知道为什么会多出那么多 table ....

    public var popData:[(icon:String,title:String, id: String)]! = [(icon:String,title:String, id: String)](){
        didSet{
            //计算行高
            rowHeightValue = (self.myFrame.height - arrowViewHeight)/CGFloat(popData.count)
        }
    }

2、touchesBegan 会导致连 Table 的 Cell 都点不了, 问题调的很蛋疼...

    override public func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
        super.touchesBegan(touches, with: event)
        if touches.first?.view?.tag != 1 {
            dismiss()
        }
    }

建议给 tableCell 的 content 添加 tag = 1

    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        //...
        self.contentView.tag = 1
        //...
    }

唉 ... 调试控件的时间自己都写一个出来了 😓

raisezhang avatar Sep 20 '17 16:09 raisezhang