You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.3 KiB

  1. //
  2. // FLEXDictionaryExplorerViewController.m
  3. // Flipboard
  4. //
  5. // Created by Ryan Olson on 5/16/14.
  6. // Copyright (c) 2014 Flipboard. All rights reserved.
  7. //
  8. #import "FLEXDictionaryExplorerViewController.h"
  9. #import "FLEXRuntimeUtility.h"
  10. #import "FLEXObjectExplorerFactory.h"
  11. @interface FLEXDictionaryExplorerViewController ()
  12. @property (nonatomic, readonly) NSDictionary *dictionary;
  13. @end
  14. @implementation FLEXDictionaryExplorerViewController
  15. - (NSDictionary *)dictionary
  16. {
  17. return [self.object isKindOfClass:[NSDictionary class]] ? self.object : nil;
  18. }
  19. #pragma mark - Superclass Overrides
  20. - (NSString *)customSectionTitle
  21. {
  22. return @"Dictionary Objects";
  23. }
  24. - (NSArray *)customSectionRowCookies
  25. {
  26. return self.dictionary.allKeys;
  27. }
  28. - (NSString *)customSectionTitleForRowCookie:(id)rowCookie
  29. {
  30. return [FLEXRuntimeUtility descriptionForIvarOrPropertyValue:rowCookie];
  31. }
  32. - (NSString *)customSectionSubtitleForRowCookie:(id)rowCookie
  33. {
  34. return [FLEXRuntimeUtility descriptionForIvarOrPropertyValue:self.dictionary[rowCookie]];
  35. }
  36. - (UIViewController *)customSectionDrillInViewControllerForRowCookie:(id)rowCookie
  37. {
  38. return [FLEXObjectExplorerFactory explorerViewControllerForObject:self.dictionary[rowCookie]];
  39. }
  40. - (BOOL)shouldShowDescription
  41. {
  42. return NO;
  43. }
  44. @end