FLEXTableView.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 UITableViewCell 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 FLEXSubtitleTableViewCell which uses monospaced fonts for both labels
  20. extern FLEXTableViewCellReuseIdentifier const kFLEXCodeFontCell;
  21. #pragma mark - FLEXTableView
  22. @interface FLEXTableView : UITableView
  23. + (instancetype)flexDefaultTableView;
  24. + (instancetype)groupedTableView;
  25. + (instancetype)plainTableView;
  26. + (instancetype)style:(UITableViewStyle)style;
  27. /// You do not need to register classes for any of the default reuse identifiers above
  28. /// (annotated as \c FLEXTableViewCellReuseIdentifier types) unless you wish to provide
  29. /// a custom cell for any of those reuse identifiers. By default, \c FLEXTableViewCell,
  30. /// \c FLEXSubtitleTableViewCell, and \c FLEXMultilineTableViewCell are used, respectively.
  31. ///
  32. /// @param registrationMapping A map of reuse identifiers to \c UITableViewCell (sub)class objects.
  33. - (void)registerCells:(NSDictionary<NSString *, Class> *)registrationMapping;
  34. @end