//
//  UIView+PointInside.swift
//  Gengmei
//
//  Created by wangyang on 2017/10/30.
//  Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//

import Foundation

@objc public extension UIView {
    /// 为view竖直方向增加一些热区
    func gm_point(inside point: CGPoint, with event: UIEvent?) -> Bool {
        if bounds.height > 35 {
            return bounds.contains(point)
        }
        let heightDelta = 35 - bounds.size.height
        let maxBounds = bounds.insetBy(dx: 0, dy: -0.5 * heightDelta)
        return maxBounds.contains(point)
    }
}
