FLEXObjectExplorerViewController.h 1.9 KB

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