MGLNetworkConfiguration


@interface MGLNetworkConfiguration : NSObject

The MGLNetworkConfiguration object provides a global way to set a base NSURLSessionConfiguration, and other resources.

  • Returns the shared instance of the MGLNetworkConfiguration class.

    Declaration

    Objective-C

    @property (class, nonatomic, readonly) MGLNetworkConfiguration *_Nonnull sharedManager;

    Swift

    class var sharedManager: MGLNetworkConfiguration { get }
  • The session configuration object that is used by the NSURLSession objects in this SDK.

    If this property is set to nil or if no session configuration is provided this property is set to the default session configuration.

    Assign this object before instantiating any MGLMapView object, or using MGLOfflineStorage

    Note

    NSURLSession objects store a copy of this configuration. Any further changes to mutable properties on this configuration object passed to a session’s initializer will not affect the behavior of that session.

    Note

    Background sessions are not currently supported.

    Declaration

    Objective-C

    @property (strong, null_resettable) NSURLSessionConfiguration *sessionConfiguration;

    Swift

    var sessionConfiguration: URLSessionConfiguration! { get set }
  • A Boolean value indicating whether the current NSURLSessionConfiguration stops making network requests.

    When this property is set to NO MGLMapView will rely solely on pre-cached tiles.

    The default value of this property is YES.

    Declaration

    Objective-C

    @property BOOL connected;

    Swift

    var connected: Bool { get set }