FLEXNetworkObserver.h 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // FLEXNetworkObserver.h
  3. // Derived from:
  4. //
  5. // PDAFNetworkDomainController.h
  6. // PonyDebugger
  7. //
  8. // Created by Mike Lewis on 2/27/12.
  9. //
  10. // Licensed to Square, Inc. under one or more contributor license agreements.
  11. // See the LICENSE file distributed with this work for the terms under
  12. // which Square, Inc. licenses this file to you.
  13. //
  14. extern NSString *const kFLEXNetworkObserverEnabledStateChangedNotification;
  15. /// This class swizzles NSURLConnection and NSURLSession delegate methods to observe events in the URL loading system.
  16. /// High level network events are sent to the default FLEXNetworkRecorder instance which maintains the request history and caches response bodies.
  17. @interface FLEXNetworkObserver : NSObject
  18. /// Swizzling occurs when the observer is enabled for the first time.
  19. /// This reduces the impact of FLEX if network debugging is not desired.
  20. + (void)setEnabled:(BOOL)enabled;
  21. + (BOOL)isEnabled;
  22. /// The enable on launch setting is persisted accross launches of the app.
  23. /// If YES, the observer will automatically enable itself early in the application lifecycle.
  24. + (void)setShouldEnableOnLaunch:(BOOL)shouldEnableOnLaunch;
  25. + (BOOL)shouldEnableOnLaunch;
  26. @end