FLEXManager.h 2.7 KB

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