FLEXManager.h 2.7 KB

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