GKBaseTableViewController.m 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // GKBaseTableViewController.m
  3. // GKPageScrollView
  4. //
  5. // Created by QuintGao on 2018/10/28.
  6. // Copyright © 2018 QuintGao. All rights reserved.
  7. //
  8. #import "GKBaseTableViewController.h"
  9. @interface GKBaseTableViewController ()
  10. @end
  11. @implementation GKBaseTableViewController
  12. - (void)viewDidLoad {
  13. [super viewDidLoad];
  14. [self.view addSubview:self.tableView];
  15. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  16. make.edges.equalTo(self.view);
  17. }];
  18. }
  19. #pragma mark - UITableViewDataSource & UITableViewDelegate
  20. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  21. return 0;
  22. }
  23. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  24. return nil;
  25. }
  26. #pragma mark - 懒加载
  27. - (UITableView *)tableView {
  28. if (!_tableView) {
  29. _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
  30. _tableView.dataSource = self;
  31. _tableView.delegate = self;
  32. if (@available(iOS 11.0, *)) {
  33. _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
  34. }
  35. }
  36. return _tableView;
  37. }
  38. @end