diff --git a/iphone/Maps/Classes/Components/MWMTableViewController.m b/iphone/Maps/Classes/Components/MWMTableViewController.m index db88678f3a..86d6c42e07 100644 --- a/iphone/Maps/Classes/Components/MWMTableViewController.m +++ b/iphone/Maps/Classes/Components/MWMTableViewController.m @@ -19,17 +19,18 @@ return NO; } -- (void)viewWillAppear:(BOOL)animated +- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section { - [super viewWillAppear:animated]; - - for (NSInteger i = 0; i < [self numberOfSectionsInTableView:self.tableView]; i++) { - [self updateHeaderView:[self.tableView headerViewForSection:i]]; - } + [self fixHeaderAndFooterFontsInDarkMode:view]; +} + +- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section +{ + [self fixHeaderAndFooterFontsInDarkMode:view]; } // Fix table section header font color for all tables, including Setting and Route Options. -- (void)updateHeaderView:(UIView*)headerView { +- (void)fixHeaderAndFooterFontsInDarkMode:(UIView*)headerView { if ([headerView isKindOfClass: [UITableViewHeaderFooterView class]]) { UITableViewHeaderFooterView* header = (UITableViewHeaderFooterView *)headerView; header.textLabel.textColor = [UIColor blackSecondaryText]; @@ -51,10 +52,6 @@ forCellReuseIdentifier:[MWMTableViewSubtitleCell className]]; } -- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section { - [self updateHeaderView:view]; -} - #pragma mark - Properties - (BOOL)hasNavigationBar