From 9882a89e3549f5be42361de4e3eddaaf750523d1 Mon Sep 17 00:00:00 2001 From: Jorge Bernal Date: Thu, 17 Dec 2015 15:04:58 +0100 Subject: [PATCH] Accept plain views as section header/footer It makes integration with Swift easier. If the view is not a UITableViewHeaderFooterView, we don't touch it. --- WordPress-iOS-Shared/Core/WPStyleGuide.h | 4 ++-- WordPress-iOS-Shared/Core/WPStyleGuide.m | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/WordPress-iOS-Shared/Core/WPStyleGuide.h b/WordPress-iOS-Shared/Core/WPStyleGuide.h index 7fecba0..1684774 100644 --- a/WordPress-iOS-Shared/Core/WPStyleGuide.h +++ b/WordPress-iOS-Shared/Core/WPStyleGuide.h @@ -69,8 +69,8 @@ + (void)configureTableViewActionCell:(UITableViewCell *)cell; + (void)configureTableViewDestructiveActionCell:(UITableViewCell *)cell; + (void)configureTableViewTextCell:(WPTextFieldTableViewCell *)cell; -+ (void)configureTableViewSectionHeader:(UITableViewHeaderFooterView *)header; -+ (void)configureTableViewSectionFooter:(UITableViewHeaderFooterView *)footer; ++ (void)configureTableViewSectionHeader:(UIView *)header; ++ (void)configureTableViewSectionFooter:(UIView *)footer; // Move to a feature category + (UIColor *)buttonActionColor; diff --git a/WordPress-iOS-Shared/Core/WPStyleGuide.m b/WordPress-iOS-Shared/Core/WPStyleGuide.m index 43d3cb1..3a23d19 100644 --- a/WordPress-iOS-Shared/Core/WPStyleGuide.m +++ b/WordPress-iOS-Shared/Core/WPStyleGuide.m @@ -415,12 +415,18 @@ + (void)configureTableViewTextCell:(WPTextFieldTableViewCell *)cell + (void)configureTableViewSectionHeader:(UITableViewHeaderFooterView *)header { + if (![header isKindOfClass:[UITableViewHeaderFooterView class]]) { + return; + } header.textLabel.font = [self tableviewSectionHeaderFont]; header.textLabel.textColor = [self whisperGrey]; } + (void)configureTableViewSectionFooter:(UITableViewHeaderFooterView *)footer { + if (![footer isKindOfClass:[UITableViewHeaderFooterView class]]) { + return; + } footer.textLabel.font = [self subtitleFont]; footer.textLabel.textColor = [self greyDarken10]; }