HitTest get the most appropriate point
@implementationHmgreenview- (void) Touchesbegan: (Nsset *) touches withevent: (Uievent *)Event{NSLog (@"%s", __func__);} get a view of the most appropriate point //-(UIView *) HitTest: (cgpoint) point withevent: (Uievent *) event//{// //put your point on the DOT conversion button on the coordinate system//Cgpoint buttonpoint = [self convertpoint:point toview:_button];// //if ([_button pointinside:buttonpoint withevent:event]) return nil; I'm not the most appropriate point. //// //return [Super Hittest:point withevent:event];//}//Judging is not the most appropriate point-(BOOL) Pointinside: (cgpoint) point withevent: (Uievent *)Event{ //converts a point on the left control to a point on the right top control//Cgpoint buttonpoint = [self convertpoint:point Toview:_button]; //convert from the point on the right view to the point on the coordinateCgpoint Buttonpoint =[_button convertpoint:point fromview:self]; if([_button pointinside:buttonpoint withevent:Event])returnNO; //oneself is not the most suitable point return[Super Pointinside:point Withevent:Event];}@end
iOS 15th day (2, event handling HitTest exercise)