summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLOfflinePack.h
diff options
context:
space:
mode:
Diffstat (limited to 'platform/darwin/src/MGLOfflinePack.h')
-rw-r--r--platform/darwin/src/MGLOfflinePack.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLOfflinePack.h b/platform/darwin/src/MGLOfflinePack.h
index 3d22f74e72..7b241e0248 100644
--- a/platform/darwin/src/MGLOfflinePack.h
+++ b/platform/darwin/src/MGLOfflinePack.h
@@ -103,6 +103,20 @@ typedef struct __attribute__((objc_boxable)) MGLOfflinePackProgress {
To create an instance of `MGLOfflinePack`, use the
`+[MGLOfflineStorage addPackForRegion:withContext:completionHandler:]` method.
A pack created using `-[MGLOfflinePack init]` is immediately invalid.
+
+ ### Example
+ ```swift
+ MGLOfflineStorage.shared.addPack(for: region, withContext: context!) { (pack, error) in
+ guard error == nil else {
+ // If download fails, log the error to the console
+ print("Error: \(error?.localizedDescription ?? "unknown error")")
+ return
+ }
+
+ // Start an MGLOfflinePack download
+ pack!.resume()
+ }
+ ```
*/
MGL_EXPORT
@interface MGLOfflinePack : NSObject