FLEXObjectExplorerViewController.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // FLEXObjectExplorerViewController.h
  3. // Flipboard
  4. //
  5. // Created by Ryan Olson on 2014-05-03.
  6. // Copyright (c) 2014 Flipboard. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef NS_ENUM(NSUInteger, FLEXObjectExplorerSection) {
  10. FLEXObjectExplorerSectionDescription,
  11. FLEXObjectExplorerSectionCustom,
  12. FLEXObjectExplorerSectionProperties,
  13. FLEXObjectExplorerSectionIvars,
  14. FLEXObjectExplorerSectionMethods,
  15. FLEXObjectExplorerSectionClassMethods,
  16. FLEXObjectExplorerSectionSuperclasses
  17. };
  18. @interface FLEXObjectExplorerViewController : UITableViewController
  19. @property (nonatomic, strong) id object;
  20. // Sublasses can override the methods below to provide data in a custom section.
  21. // The subclass should provide an array of "row cookies" to allow retreival of individual row data later on.
  22. // The objects in the rowCookies array will be used to call the row title, subtitle, etc methods to consturct the rows.
  23. // The cookies approach is used here because we may filter the visible rows based on the search text entered by the user.
  24. - (NSString *)customSectionTitle;
  25. - (NSArray *)customSectionRowCookies;
  26. - (NSString *)customSectionTitleForRowCookie:(id)rowCookie;
  27. - (NSString *)customSectionSubtitleForRowCookie:(id)rowCookie;
  28. - (BOOL)customSectionCanDrillIntoRowWithCookie:(id)rowCookie;
  29. - (UIViewController *)customSectionDrillInViewControllerForRowCookie:(id)rowCookie;
  30. // More subclass configuration hooks.
  31. /// Whether to allow showing/drilling in to current values for ivars and properties. Defalut is YES.
  32. - (BOOL)canHaveInstanceState;
  33. /// Whether to allow drilling in to method calling interfaces for instance methods. Default is YES.
  34. - (BOOL)canCallInstanceMethods;
  35. /// If the custom section data makes the description redundant, subclasses can choose to hide it. Default is YES.
  36. - (BOOL)shouldShowDescription;
  37. /// Subclasses can reorder/change which sections can display directly by overriding this method.
  38. - (NSArray *)possibleExplorerSections;
  39. @end