FLEXColorPreviewSection.m 619 B

12345678910111213141516171819202122232425262728293031
  1. //
  2. // FLEXColorPreviewSection.m
  3. // FLEX
  4. //
  5. // Created by Tanner Bennett on 12/12/19.
  6. // Copyright © 2020 FLEX Team. All rights reserved.
  7. //
  8. #import "FLEXColorPreviewSection.h"
  9. @implementation FLEXColorPreviewSection
  10. + (instancetype)forObject:(UIColor *)color {
  11. return [self title:@"Color" reuse:nil cell:^(__kindof UITableViewCell *cell) {
  12. cell.backgroundColor = color;
  13. }];
  14. }
  15. - (BOOL)canSelectRow:(NSInteger)row {
  16. return NO;
  17. }
  18. - (BOOL (^)(NSString *))filterMatcher {
  19. return ^BOOL(NSString *filterText) {
  20. // Hide when searching
  21. return !filterText.length;
  22. };
  23. }
  24. @end