This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathMGLNetworkConfiguration.h
79 lines (58 loc) · 2.28 KB
/
MGLNetworkConfiguration.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#import <Foundation/Foundation.h>
#import "MGLFoundation.h"
NS_ASSUME_NONNULL_BEGIN
@class MGLNetworkConfiguration;
@protocol MGLNetworkConfigurationDelegate <NSObject>
@optional
/**
:nodoc:
Provides an `NSURLSession` object for the specified `MGLNetworkConfiguration`.
This API should be considered experimental, likely to be removed or changed in
future releases.
This method is called from background threads, i.e. it is not called on the main
thread.
@note Background sessions (i.e. created with
`-[NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:]`)
and sessions created with a delegate that conforms to `NSURLSessionDataDelegate`
are not supported at this time.
*/
- (NSURLSession *)sessionForNetworkConfiguration:(MGLNetworkConfiguration *)configuration;
@end
/**
The `MGLNetworkConfiguration` object provides a global way to set a base
`NSURLSessionConfiguration`, and other resources.
*/
MGL_EXPORT
@interface MGLNetworkConfiguration : NSObject
/**
:nodoc:
Delegate for the `MGLNetworkConfiguration` class.
*/
@property (nonatomic, weak) id<MGLNetworkConfigurationDelegate> delegate;
/**
Returns the shared instance of the `MGLNetworkConfiguration` class.
*/
@property (class, nonatomic, readonly) MGLNetworkConfiguration *sharedManager;
/**
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.
*/
@property (atomic, strong, null_resettable) NSURLSessionConfiguration *sessionConfiguration;
/**
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`.
*/
@property (atomic, assign) BOOL connected;
@end
NS_ASSUME_NONNULL_END