FLEXManager+Networking.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //
  2. // FLEXManager+Networking.h
  3. // FLEX
  4. //
  5. // Created by Tanner on 2/1/20.
  6. // Copyright © 2020 Flipboard. All rights reserved.
  7. //
  8. #import "FLEXManager.h"
  9. @interface FLEXManager (Networking)
  10. /// If this property is set to YES, FLEX will swizzle NSURLConnection*Delegate and NSURLSession*Delegate methods
  11. /// on classes that conform to the protocols. This allows you to view network activity history from the main FLEX menu.
  12. /// Full responses are kept temporarily in a size-limited cache and may be pruned under memory pressure.
  13. @property (nonatomic, getter=isNetworkDebuggingEnabled) BOOL networkDebuggingEnabled;
  14. /// Defaults to 25 MB if never set. Values set here are persisted across launches of the app.
  15. /// The response cache uses an NSCache, so it may purge prior to hitting the limit when the app is under memory pressure.
  16. @property (nonatomic) NSUInteger networkResponseCacheByteLimit;
  17. /// Requests whose host ends with one of the blacklisted entries in this array will be not be recorded (eg. google.com).
  18. /// Wildcard or subdomain entries are not required (eg. google.com will match any subdomain under google.com).
  19. /// Useful to remove requests that are typically noisy, such as analytics requests that you aren't interested in tracking.
  20. @property (nonatomic, copy) NSArray<NSString *> *networkRequestHostBlacklist;
  21. /// Sets custom viewer for specific content type.
  22. /// @param contentType Mime type like application/json
  23. /// @param viewControllerFutureBlock Viewer (view controller) creation block
  24. /// @note This method must be called from the main thread.
  25. /// The viewControllerFutureBlock will be invoked from the main thread and may not return nil.
  26. /// @note The passed block will be copied and retain for the duration of the application, you may want to use __weak references.
  27. - (void)setCustomViewerForContentType:(NSString *)contentType
  28. viewControllerFutureBlock:(FLEXCustomContentViewerFuture)viewControllerFutureBlock;
  29. @end