自定义UIControl 时最好实现下
**override** **func** touchesEnded(_ touches: Set<UITouch>, with event: UIEvent?) {
**super**.touchesEnded(touches, with: event)
sendActions(for: .touchUpInside)
}
手动触发事件,否则UIcontrol添加到UIStackView的时候,点击事件不生效
第二种方式会影响UIStackView中子view的点击事件当设置UIStackView的isUserInteractionEnabled为false时,虽然自定义control能正常接收事件,但是button等的点击事件就会不生效,不推荐这种方式