Touch event in UIView is not notified

We are developing with objective-c.

Allocate the UITableViewCell class to the screen of the UITableView class and I'm trying to allocate an image of the UIView class in the process inside the UITableViewCell class and process the touch event for it. touchesEnded is not called. Below is part of the code.

// UITableView:PhotoListViewController.m
- (void)viewDidLoad
{
    [super viewDidLoad];
    if (self.tableView == nil) {
        self.tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStylePlain];
        self.tableView.backgroundColor = BODY_COLOR;
        self.tableView.translatesAutoresizingMaskIntoConstraints = NO;
        if (@available(iOS 11.0, *)) {
            self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentAutomatic;
        } 
        [self.tableView.layer setBorderColor:LOG_COLOR.CGColor];
        [self.tableView.layer setBorderWidth:4.0f];
        self.tableView.delegate = self;
        self.tableView.dataSource = self;
        [self.view addSubview:self.tableView];
    }
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;

	self.tableView.userInteractionEnabled = YES;
	self.view.userInteractionEnabled = YES;

    //savebutton
    CGRect frame = saveBarController_.view.frame;
    frame.origin.y = self.tableView.frame.size.height;
    saveBarController_.view.frame = frame;
    [self.view addSubview:saveBarController_.view];
    
    PRINT_RECT(saveBarController_.view.frame);

    [self.tableView reloadData];

    PBDataManager *manager = [[[PBDataManager alloc]init] autorelease];
    [manager save:nil];
}

- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"cell";
    
    ThumbnailCell *cell = (ThumbnailCell *)[aTableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[ThumbnailCell alloc]init]autorelease];
    }
    
    [cell setThumbnail:[thumbnailManager_ thumbnailAtRow:indexPath.row]];
    cell.backgroundColor = [UIColor clearColor];
    return cell;
}
// UITableViewCell:ThumbnailCell.m
- (id)init
{
    self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"];
    
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        thumbnailViews_ = [[NSArray arrayWithObjects:
                        [[[ThumbnailView alloc]init]autorelease]
                        ,[[[ThumbnailView alloc]init]autorelease]
                        ,[[[ThumbnailView alloc]init]autorelease]
                        ,[[[ThumbnailView alloc]init]autorelease]
                        ,nil]retain];
        int count = 1;
        int margin = 4;
        int width = 75;
        
        for (ThumbnailView *thumb in thumbnailViews_) {
            thumb.frame = CGRectMake(count * margin + (count-1) * width, 4, 75, 75);
            thumb.autoresizingMask = 0;
            thumb.userInteractionEnabled = YES;
            [self addSubview:thumb];
            count++;
        }
    }
    return self;
}

// UIView:ThumbnailView.m
- (id)init
{
    self = [super initWithFrame:CGRectMake(0, 0, 75, 75)];
    if (self) {
        [self setupLayer];
    }
    return self;
}
- (void)setupLayer
{
	imageLayer_ = [[UIImageView alloc]initWithFrame:self.bounds];
	imageLayer_.frame = self.bounds;
	videoLayer_ = [[UIImageView alloc]initWithFrame:self.bounds];
	videoLayer_.frame = self.bounds;
	duration_ = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, 40, 15)];
	duration_.backgroundColor = [UIColor clearColor];
	duration_.frame = CGRectMake(30, 60, 40, 15);
	[self addSubview:imageLayer_];
	[self addSubview:videoLayer_];
	[self addSubview:duration_];
}

- (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
// Touch event is not notified
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
// Touch event is not notified
}

- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
// Touch event is not notified
}

- (void)touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
// Touch event is not notified
}

This is the code of an old project around 2016, and the touch event is not notified when running on the current OS. iPhone5: iOS10.3.4 In contrast to the above code, you will receive a touch event notification on your device. iPad (7th generation): iOS 15.1 You will not receive touch event notifications on your device. I don't know the cause, so what should I do?

The development environment is Xcode12.5 Will be.

I look forward to working with you.

Are the "ThumbnailView" frames being set up correctly?
That is, do thay have a tappable area?

(You could double-check this by giving them a colored background.)

Sorry for this very basic question. How do you test that Touch event is not notified

It's old code https://github.com/naonya3/LMImagesPickerController It will be the code created by diverting. You can check the operation in this project.

Sorry, I cannot take the time to go and search in a GitHub archive. Please answer precisely to the question: "How do you test that Touch event is not notified"

"ThumbnailCell.m" and "ThumbnailView.m"

-(void) touchesEnded: (NSSet *) touches withEvent: (UIEvent *) event -(void) touchesBegan: (NSSet *) touches withEvent: (UIEvent *) event -(void) touchesMoved: (NSSet *) touches withEvent: (UIEvent *) event -(void) touchesCancelled: (NSSet *) touches withEvent: (UIEvent *) event

A breakpoint is set in, and the thumbnail displayed on the actual iPad (iOS 15.1) is touched for testing. While "ThumbnailCell.m" can get notifications of touch events, Touch event notifications cannot be obtained with "ThumbnailView.m".

Instead of breakpoint, try to insert a print statement.

Since the event is not notified as usual, print is not performed either.

Touch event in UIView is not notified
 
 
Q