FLEXTableView.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. //
  2. // FLEXTableView.h
  3. // FLEX
  4. //
  5. // Created by Tanner on 4/17/19.
  6. // Copyright © 2019 Flipboard. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #pragma mark Reuse identifiers
  10. typedef NSString * FLEXTableViewCellReuseIdentifier;
  11. /// A regular \c FLEXTableViewCell initialized with \c UITableViewCellStyleDefault
  12. extern FLEXTableViewCellReuseIdentifier const kFLEXDefaultCell;
  13. /// A \c FLEXSubtitleTableViewCell initialized with \c UITableViewCellStyleSubtitle
  14. extern FLEXTableViewCellReuseIdentifier const kFLEXDetailCell;
  15. /// A \c FLEXMultilineTableViewCell initialized with \c UITableViewCellStyleDefault
  16. extern FLEXTableViewCellReuseIdentifier const kFLEXMultilineCell;
  17. /// A \c FLEXMultilineTableViewCell initialized with \c UITableViewCellStyleSubtitle
  18. extern FLEXTableViewCellReuseIdentifier const kFLEXMultilineDetailCell;
  19. /// A \c FLEXTableViewCell initialized with \c UITableViewCellStyleValue1
  20. extern FLEXTableViewCellReuseIdentifier const kFLEXKeyValueCell;
  21. /// A \c FLEXSubtitleTableViewCell which uses monospaced fonts for both labels
  22. extern FLEXTableViewCellReuseIdentifier const kFLEXCodeFontCell;
  23. #pragma mark - FLEXTableView
  24. @interface FLEXTableView : UITableView
  25. + (instancetype)flexDefaultTableView;
  26. + (instancetype)groupedTableView;
  27. + (instancetype)plainTableView;
  28. + (instancetype)style:(UITableViewStyle)style;
  29. /// You do not need to register classes for any of the default reuse identifiers above
  30. /// (annotated as \c FLEXTableViewCellReuseIdentifier types) unless you wish to provide
  31. /// a custom cell for any of those reuse identifiers. By default, \c FLEXTableViewCell,
  32. /// \c FLEXSubtitleTableViewCell, and \c FLEXMultilineTableViewCell are used, respectively.
  33. ///
  34. /// @param registrationMapping A map of reuse identifiers to \c UITableViewCell (sub)class objects.
  35. - (void)registerCells:(NSDictionary<NSString *, Class> *)registrationMapping;
  36. @end