12345678910111213141516171819 |
- //
- // XXButton.swift
- // Inhealth
- //
- // Created by weclouds on 2019/12/13.
- // Copyright © 2019 weclouds. All rights reserved.
- //
- import UIKit
- class XXButton: UIButton {
- override func point(inside point: CGPoint, with event: UIEvent?) -> Bool {
- let margin: CGFloat = 15
- let area = self.bounds.insetBy(dx: -margin, dy: -margin) //负值是方法响应范围
- return area.contains(point)
- }
- }
|