//
// BackgroundView.m
// test_hitTest_01
//
// Created by jeffasd on 13/11/5.
// Copyright © 2013年 jeffasd. All rights reserved.
//
#import "BackgroundView.h"
@implementation BackgroundView
- (instancetype)initWithFrame:(CGRect)frame{
if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor cyanColor];
}
return self;
}
- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
}
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
}
- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
}
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{
NSLog(@"hitTest");
// return nil;
// return self;
NSLog(@"self is %@", self);
UIView *view = [super hitTest:point withEvent:event];
NSLog(@"super view is %@", view);
return view;
}
- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event{
NSLog(@"pointInside");
// return NO;
return YES;
}
@end
屏幕触摸事件传递
最新推荐文章于 2020-08-10 22:24:30 发布