FLEXNetworkObserver.h 1.0 KB

123456789101112131415161718192021222324252627282930
  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. #import <Foundation/Foundation.h>
  15. extern NSString *const kFLEXNetworkObserverEnabledStateChangedNotification;
  16. /// This class swizzles NSURLConnection and NSURLSession delegate methods to observe events in the URL loading system.
  17. /// High level network events are sent to the default FLEXNetworkRecorder instance which maintains the request history and caches response bodies.
  18. @interface FLEXNetworkObserver : NSObject
  19. /// Swizzling occurs when the observer is enabled for the first time.
  20. /// This reduces the impact of FLEX if network debugging is not desired.
  21. /// NOTE: this setting persists between launches of the app.
  22. + (void)setEnabled:(BOOL)enabled;
  23. + (BOOL)isEnabled;
  24. @end