import UIKit
class ExtendableAreaButton: UIButton {
var hitOffset = UIEdgeInsetsZero
override func pointInside(point: CGPoint, withEvent event: UIEvent?) -> Bool {
guard hitOffset != UIEdgeInsetsZero && enabled && !hidden else {
return super.pointInside(point, withEvent: event)
}
return UIEdgeInsetsInsetRect(bounds, hitOffset).contains(point)
}
}
import UIKit
class ExtendableAreaButton: UIButton {
var hitOffset = UIEdgeInsetsZero
override func pointInside(point: CGPoint, withEvent event: UIEvent?) -> Bool {
guard hitOffset != UIEdgeInsetsZero && enabled && !hidden else {
return super.pointInside(point, withEvent: event)
}
return UIEdgeInsetsInsetRect(bounds, hitOffset).contains(point)
}
}
import UIKit class ExtendableAreaButton: UIButton { var hitOffset = UIEdgeInsetsZero override func pointInside(point: CGPoint, withEvent event: UIEvent?) -> Bool { guard hitOffset != UIEdgeInsetsZero && enabled && !hidden else { return super.pointInside(point, withEvent: event) } return UIEdgeInsetsInsetRect(bounds, hitOffset).contains(point) } }