Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@raisezhang

Description

@raisezhang

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
        //...
    }

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions