summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLOfflinePack.mm
Commit message (Collapse)AuthorAgeFilesLines
* Make `MGLOfflinePack` instances post notificationsEimantas Vaiciunas2017-02-061-4/+27
| | | | | | | This commit also gets rid of private `MGLOfflinePackDelegate` protocol. `userInfo` dictionary in notification objects retain the `state` and `progress` values for backwards compatibility. They can be removed in later major release.
* [core] remove trailing whitespace, add trailing newlines, add space after //Konstantin Käfer2017-01-271-23/+23
|
* [ios, macos] Ignore progress updates after suspendingMinh Nguyễn2016-09-201-2/+18
| | | | -suspend and -resume are now presumed to be synchronous, even if technically they remain asynchronous under the hood.
* [ios, osx] Add countOfTilesCompleted bindingJohn Firebaugh2016-04-271-0/+1
|
* [ios, osx] Add a property for bytes used by offline tilesBrent Whitman2016-04-271-0/+1
|
* [ios, osx] Updated build system for jazzyMinh Nguyễn2016-04-221-14/+0
| | | | Consolidated NSValue categories to work around realm/jazzy#539. Documented MGLErrorCode. Moved jazzy configuration file into platform/ios/. Removed redundant include/Mapbox.h that was only being used by jazzy, now that the static frameworks’s umbrella header is based on that of the dynamic framework. Moved framework/Mapbox.h to include/Mapbox.h for consistency.
* [ios] Moved SDK from gyp into Xcode projectMinh Nguyễn2016-04-161-1/+0
| | | | | | | | | | | | | | Added a new Cocoa Touch dynamic framework target and Cocoa Touch static library target to the main iOS Xcode project. The targets are based on the templates provided by Xcode. They contain headers and source files in the darwin/ and ios/ subdirectories. Headers are explicitly marked public or project-internal instead of implicitly by subdirectory. The SDK targets have a few dependencies that are managed by mason. Transform the config.gypi generated by configure into an .xcconfig file that Xcode uses to fill in compiler and linker flags. Removed the iossdk target from platform.gypi and pared down the platform-lib target. make iproj opens the overall Xcode workspace instead of just the core project. Resolved some warnings that are only now appearing because we’re using the standard warning and error flags instead of the pedantic and somewhat inappropriate flags that were forced by the gyp configuration files. Removed a console message informing developers of a long-ago deleted delegate method; the message was triggering a “selector not found” warning. Conditionalized some deprecated symbol usage that’s still needed for the static framework but not the dynamic framework, due to differing minimum deployment targets. Added a build phase to the static library target that copies headers for use with the static library itself. This would allow us to potentially include a header in the dynamic framework but not the static library and vice-versa. Updated the changelog to note that unused SVG files have been removed from the distribution.
* [ios, osx] Require progress to be requested manuallyMinh Nguyễn2016-03-291-2/+1
| | | | Requesting progress is expensive, so it is once again computed only on demand, rather than automatically at launch. Moved progress requesting back to iosapp and osxapp.
* [ios, osx] Include progress in progress change notificationMinh Nguyễn2016-03-291-0/+14
| | | | 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.
* [ios, osx] Allow creating invalid offline packsMinh Nguyễn2016-03-291-6/+6
| | | | | | Removed NS_UNAVAILABLE attribute from -[MGLOfflinePack init]. Packs initialized with this initializer are doomed to invalidity. Fixes #4421.
* [ios, osx] More accurate KVO, private delegate, descriptive fallback name, ↵Minh Nguyễn2016-03-291-15/+9
| | | | | | | | | | | | fewer reloads Made MGLOfflineStorage.packs strong rather than copy so that KVO notifications on that key path include index paths. Replaced custom KVO mutable collection methods with calls to -mutableArrayValueForKey:, avoiding redundant casts. Privatized MGLOfflinePackDelegate and made its methods required, since MGLOfflineStorage is the only conforming implementation. Require a pack to be explicitly invalidated before deallocation by its owner (MGLOfflineStorage). Added a method to reload the canonical collection of packs. Previously, if the user adds an offline pack without specifying a name in the alert, the pack would be named “Untitled n” for the nth pack created since the application was launched. This logic could result in identically named packs (for example, if the user relaunches and creates another unnamed pack). Instead, use the visible coordinate bounds as a placeholder and fallback name. Resume a pack upon successful addition. Removed an extraneous weakSelf/strongSelf dance. When possible, update individual labels in a cell instead of reloading the entire cell. That way, if the user swipes to the left to reveal the Delete accessory button while the pack is actively downloading, the accessory button remains on screen as progress updates come in.
* [ios, osx] Removed pack nil check from MGLOfflineRegionObserverMinh Nguyễn2016-03-141-6/+0
| | | | Due to ARC, MGLOfflinePack can be deallocated at any time following its initialization. -dealloc ensures that the offline region observer is unset, but that step is asynchronous; there is no guarantee that it completes before the first status change update. In fact, the pack is deallocated before the first status change update unless it is captured outside of the MGLOfflinePackAdditionCompletionHandler. The pack nil check is unnecessary because the subsequent code would be a no-op.
* [ios, osx] Renamed MGLOfflineTask to MGLOfflinePackMinh Nguyễn2016-03-101-0/+218
“Offline pack” more effectively communicates the persistent nature of the downloaded content.