FLEXObjectExplorerViewController.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. FLEXObjectExplorerSectionReferencingInstances
  18. };
  19. @interface FLEXObjectExplorerViewController : UITableViewController
  20. @property (nonatomic, strong) id object;
  21. // Sublasses can override the methods below to provide data in a custom section.
  22. // The subclass should provide an array of "row cookies" to allow retreival of individual row data later on.
  23. // The objects in the rowCookies array will be used to call the row title, subtitle, etc methods to consturct the rows.
  24. // The cookies approach is used here because we may filter the visible rows based on the search text entered by the user.
  25. - (NSString *)customSectionTitle;
  26. - (NSArray *)customSectionRowCookies;
  27. - (NSString *)customSectionTitleForRowCookie:(id)rowCookie;
  28. - (NSString *)customSectionSubtitleForRowCookie:(id)rowCookie;
  29. - (BOOL)customSectionCanDrillIntoRowWithCookie:(id)rowCookie;
  30. - (UIViewController *)customSectionDrillInViewControllerForRowCookie:(id)rowCookie;
  31. // More subclass configuration hooks.
  32. /// Whether to allow showing/drilling in to current values for ivars and properties. Defalut is YES.
  33. - (BOOL)canHaveInstanceState;
  34. /// Whether to allow drilling in to method calling interfaces for instance methods. Default is YES.
  35. - (BOOL)canCallInstanceMethods;
  36. /// If the custom section data makes the description redundant, subclasses can choose to hide it. Default is YES.
  37. - (BOOL)shouldShowDescription;
  38. /// Subclasses can reorder/change which sections can display directly by overriding this method.
  39. - (NSArray *)possibleExplorerSections;
  40. @end