diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2016-03-27 22:40:15 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2016-03-29 11:46:27 -0700 |
commit | 8c8b0580388460c0addafb49c852ea8986b47ac4 (patch) | |
tree | 2e55e038689eba4d0faf71c251adca8543ea8075 /platform/darwin/src/MGLOfflinePack.mm | |
parent | aff1196d02cd06e71c7b2a15454384fd302946b1 (diff) | |
download | qtlocation-mapboxgl-8c8b0580388460c0addafb49c852ea8986b47ac4.tar.gz |
[ios, osx] Include progress in progress change notification
An MGLOfflinePackProgressChangedNotification notification now includes the pack’s state and progress values, which match the values in the corresponding MGLOfflinePack properties. Implemented NSValue category methods to store MGLOfflinePackProgress inside a dictionary.
Diffstat (limited to 'platform/darwin/src/MGLOfflinePack.mm')
-rw-r--r-- | platform/darwin/src/MGLOfflinePack.mm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/platform/darwin/src/MGLOfflinePack.mm b/platform/darwin/src/MGLOfflinePack.mm index 30b268aaf1..05ff35ec7f 100644 --- a/platform/darwin/src/MGLOfflinePack.mm +++ b/platform/darwin/src/MGLOfflinePack.mm @@ -204,3 +204,17 @@ void MBGLOfflineRegionObserver::mapboxTileCountLimitExceeded(uint64_t limit) { [pack.delegate offlinePack:pack didReceiveMaximumAllowedMapboxTiles:limit]; }); } + +@implementation NSValue (MGLOfflinePackAdditions) + ++ (NSValue *)valueWithMGLOfflinePackProgress:(MGLOfflinePackProgress)progress { + return [NSValue value:&progress withObjCType:@encode(MGLOfflinePackProgress)]; +} + +- (MGLOfflinePackProgress)MGLOfflinePackProgressValue { + MGLOfflinePackProgress progress; + [self getValue:&progress]; + return progress; +} + +@end |