In an iOS app i've been working on, I have a UITableview with headers. Headers are creating using:
-(NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
return [self.headerTitles objectAtIndex:section];
}
When I put the iOS simulator in dark mode, everything goes dark, but the text color in the headers remains black. Doesn't seem to be the case with a new stock project, but I'm wondering if there's something in this project that's making the text color not change properly. workaround is to implement:
//
-(UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section
{
NSString *headerTitle = [self.headerTitles objectAtIndex:section];
UITableViewHeaderFooterView *headerView = [tableView dequeueReusableHeaderFooterViewWithIdentifier:@"HeaderID"];
headerView.textLabel.text = headerTitle;
if (@available(iOS 13.0, *))
{
headerView.textLabel.textColor = UIColor.labelColor;
}
return headerView;
}
Anyone run into this and have an idea why I have to do this?