MBXOfflineSwitch.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file is generated and will be overwritten automatically.
  2. #import <Foundation/Foundation.h>
  3. @protocol MBXOfflineSwitchObserver;
  4. /** Instance that allows connecting or disconnecting the Mapbox stack to the network. */
  5. NS_SWIFT_NAME(OfflineSwitch)
  6. __attribute__((visibility ("default")))
  7. @interface MBXOfflineSwitch : NSObject
  8. // This class provides custom init which should be called
  9. - (nonnull instancetype)init NS_UNAVAILABLE;
  10. // This class provides custom init which should be called
  11. + (nonnull instancetype)new NS_UNAVAILABLE;
  12. /**
  13. * Connects or disconnects the Mapbox stack. If set to false, current and new HTTP requests will fail
  14. * with HttpRequestErrorType#ConnectionError.
  15. *
  16. * @param connected Set false to disconnect the Mapbox stack
  17. */
  18. - (void)setMapboxStackConnectedForConnected:(BOOL)connected;
  19. /**
  20. * Provides information if the Mapbox stack is connected or disconnected via OfflineSwitch.
  21. *
  22. * @return True if the Mapbox stack is disconnected via setMapboxStackConnected(), false otherwise.
  23. */
  24. - (BOOL)isMapboxStackConnected;
  25. /** Returns the OfflineSwitch singleton instance. */
  26. + (nonnull MBXOfflineSwitch *)getInstance __attribute((ns_returns_retained));
  27. /**
  28. * Releases the OfflineSwitch singleton instance.
  29. *
  30. * Users can call this method if they want to do manual cleanup of the resources allocated by Mapbox services.
  31. * If the user calls getInstance() after reset, a new instance of the OfflineSwitch singleton will be allocated.
  32. */
  33. + (void)reset;
  34. @end