Created
June 15, 2020 14:12
-
-
Save lightandshadow68/17eddc4a3992dd30787078079dc0fbdb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// UITableView+Appearance.h | |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
#import <UIKit/UIKit.h> | |
NS_ASSUME_NONNULL_BEGIN | |
@interface UITableView (Appearance)<UIAppearance> | |
@property (nonatomic, assign) CGFloat footerViewHeight UI_APPEARANCE_SELECTOR; | |
@end | |
NS_ASSUME_NONNULL_END | |
// UITableView+Appearance.m | |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
#import "UITableView+Appearance.h" | |
@implementation UITableView (Appearance) | |
- (CGFloat)footerViewHeight | |
{ | |
return self.tableFooterView.bounds.size.height; | |
} | |
- (void)setFooterViewHeight:(CGFloat)footerViewHeight | |
{ | |
UIView *footerView = [[UIView alloc] init]; | |
footerView.backgroundColor = UIColor.clearColor; | |
footerView.bounds = CGRectMake(0, 0, 0, footerViewHeight); | |
self.tableFooterView = footerView; | |
} | |
@end | |
// In your App / Scene Delegate | |
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - | |
#pragma mark - Appearance proxy customizations | |
- (void)performAppearanceProxyCustomizations | |
{ | |
// ... | |
// No empty table view rows | |
[UITableView appearance].footerViewHeight = FLT_EPSILON; | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment