XCode13 beta,iOS15. set tableview section header to 0. not working

self.tableView = [[UITableView alloc] initWithFrame:self.view.frame];

- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UILabel *label = [[UILabel alloc] init];
    label.text = @"test";
    return label;
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section

{

    return 0.01;

}

it works perfect on iOS14. but on iOS15 XCode13 beta. it doesn't work anymore.

have a default header which height is 22 here

Replies

problem resolved. I find sectionHeaderTopPadding...

if (@available(iOS 15.0, *)) {
    _tableView.sectionHeaderTopPadding = 0;
}

Highmore's solution but in swift:

if #available(iOS 15.0, *) {
			_tableView.sectionHeaderTopPadding = 0
		}

I put this in viewDidLoad

Thanks