2022-02-07 iOS 扩大view 点击区域
2022-02-11 本文已影响0人
cc帅气的昵称
- (BOOL)pointInside:(CGPoint)pointwithEvent:(UIEvent*)event {
CGRectbounds =self.bounds;
//扩大原热区直径至30,可以暴露个接口,用来设置需要扩大的半径。
CGFloatwidthDelta =30;
CGFloatheightDelta =30;
bounds =CGRectInset(bounds, -0.5* widthDelta, -0.5* heightDelta);
returnCGRectContainsPoint(bounds, point);
}