Files
comaps/iphone/Maps/Classes/Components/MWMTableViewController.m
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

87 lines
2.5 KiB
Objective-C

#import "MapsAppDelegate.h"
#import "MapViewController.h"
#import "MWMAlertViewController.h"
#import "MWMTableViewCell.h"
#import "MWMTableViewController.h"
#import "SwiftBridge.h"
static CGFloat const kMaxEstimatedTableViewCellHeight = 100.0;
@interface MWMTableViewController ()
@property (nonatomic, readwrite) MWMAlertViewController * alertController;
@end
@implementation MWMTableViewController
- (BOOL)prefersStatusBarHidden
{
return NO;
}
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
[self fixHeaderAndFooterFontsInDarkMode:view];
}
- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section
{
[self fixHeaderAndFooterFontsInDarkMode:view];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return UITableViewAutomaticDimension;
}
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath {
return kMaxEstimatedTableViewCellHeight;
}
// Fix table section header font color for all tables, including Setting and Route Options.
- (void)fixHeaderAndFooterFontsInDarkMode:(UIView*)headerView {
if ([headerView isKindOfClass: [UITableViewHeaderFooterView class]]) {
UITableViewHeaderFooterView* header = (UITableViewHeaderFooterView *)headerView;
header.textLabel.textColor = [UIColor blackSecondaryText];
if (self.tableView.style == UITableViewStyleGrouped) {
header.detailTextLabel.textColor = [UIColor blackSecondaryText];
}
}
}
- (void)viewDidLoad
{
[super viewDidLoad];
self.tableView.insetsContentViewsToSafeArea = YES;
self.tableView.styleName = @"TableView:PressBackground";
[self.navigationController.navigationBar setTranslucent:NO];
[self.tableView registerClass:[MWMTableViewCell class]
forCellReuseIdentifier:[UITableViewCell className]];
[self.tableView registerClass:[MWMTableViewSubtitleCell class]
forCellReuseIdentifier:[MWMTableViewSubtitleCell className]];
}
#pragma mark - Properties
- (BOOL)hasNavigationBar
{
return YES;
}
- (MWMAlertViewController *)alertController
{
if (!_alertController)
_alertController = [[MWMAlertViewController alloc] initWithViewController:self];
return _alertController;
}
@end
@implementation UITableView (MWMTableViewController)
- (UITableViewCell *)dequeueDefaultCellForIndexPath:(NSIndexPath *)indexPath {
return [self dequeueReusableCellWithIdentifier:UITableViewCell.className forIndexPath:indexPath];
}
@end