diff options
Diffstat (limited to 'platform/darwin/src/MGLOfflinePack.h')
-rw-r--r-- | platform/darwin/src/MGLOfflinePack.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/platform/darwin/src/MGLOfflinePack.h b/platform/darwin/src/MGLOfflinePack.h index 7b241e0248..3dcb5b7abe 100644 --- a/platform/darwin/src/MGLOfflinePack.h +++ b/platform/darwin/src/MGLOfflinePack.h @@ -106,15 +106,15 @@ typedef struct __attribute__((objc_boxable)) MGLOfflinePackProgress { ### 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")") + MGLOfflineStorage.shared.addPack(for: region, withContext: context) { (pack, error) in + guard let pack = pack else { + // If adding the pack fails, log an error to console. + print("Error:", error?.localizedDescription ?? "unknown error adding pack at \(#file)(\(#line)) in \(#function)") return } - + // Start an MGLOfflinePack download - pack!.resume() + pack.resume() } ``` */ |