FLEXManager.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // FLEXManager.h
  3. // Flipboard
  4. //
  5. // Created by Ryan Olson on 4/4/14.
  6. // Copyright (c) 2014 Flipboard. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @interface FLEXManager : NSObject
  10. + (instancetype)sharedManager;
  11. @property (nonatomic, readonly) BOOL isHidden;
  12. - (void)showExplorer;
  13. - (void)hideExplorer;
  14. /// If this property is set to YES, FLEX will swizzle NSURLConnection*Delegate and NSURLSession*Delegate methods
  15. /// on classes that conform to the protocols. This allows you to view network activity history from the main FLEX menu.
  16. /// Full responses are kept temporarily in a size limited cache and may be pruged under memory pressure.
  17. @property (nonatomic, assign, getter=isNetworkDebuggingEnabled) BOOL networkDebuggingEnabled;
  18. /// Defaults to 50 MB if never set. Values set here are presisted across launches of the app.
  19. /// The response cache uses an NSCache, so it may purge prior to hitting the limit when the app is under memory pressure.
  20. @property (nonatomic, assign) NSUInteger networkResponseCacheByteLimit;
  21. #pragma mark - Extensions
  22. /// Adds an entry at the bottom of the list of Global State items. Call this method before this view controller is displayed.
  23. /// @param entryName The string to be displayed in the cell.
  24. /// @param objectFutureBlock When you tap on the row, information about the object returned by this block will be displayed.
  25. /// Passing a block that returns an object allows you to display information about an object whose actual pointer may change at runtime (e.g. +currentUser)
  26. /// @note This method must be called from the main thread.
  27. /// The objectFutureBlock will be invoked from the main thread and may return nil.
  28. /// @note The passed block will be copied and retain for the duration of the application, you may want to use __weak references.
  29. - (void)registerGlobalEntryWithName:(NSString *)entryName objectFutureBlock:(id (^)(void))objectFutureBlock;
  30. /// Adds an entry at the bottom of the list of Global State items. Call this method before this view controller is displayed.
  31. /// @param entryName The string to be displayed in the cell.
  32. /// @param viewControllerFutureBlock When you tap on the row, view controller returned by this block will be pushed on the navigation controller stack.
  33. /// @note This method must be called from the main thread.
  34. /// The viewControllerFutureBlock will be invoked from the main thread and may not return nil.
  35. /// @note The passed block will be copied and retain for the duration of the application, you may want to use __weak references.
  36. - (void)registerGlobalEntryWithName:(NSString *)entryName
  37. viewControllerFutureBlock:(UIViewController * (^)(void))viewControllerFutureBlock;
  38. @end