FLEXTableView.h 1.9 KB

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