FLEXManager+Networking.h 2.0 KB

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