diff options
author | Nadia Barbosa <nadiabarbosa@me.com> | 2019-04-29 17:19:38 -0700 |
---|---|---|
committer | Nadia Barbosa <captainbarbosa@users.noreply.github.com> | 2019-05-01 18:30:46 -0700 |
commit | 3e4afbc788424ef4d89d48f4d29204d1593f769d (patch) | |
tree | eec17784d7f5fcad6bc83fc8ffc4ce871a81f0cc /platform/ios/app/MBXViewController.m | |
parent | 8b91a4a037ab84cafd40b62da0224e3baf100168 (diff) | |
download | qtlocation-mapboxgl-3e4afbc788424ef4d89d48f4d29204d1593f769d.tar.gz |
[iosapp] Move token setting to build script
[ios] Switch to script-based token insertion for benchmarking app
[ios] Update Developing.md
[iosapp, benchmark app] Look for token file outside of version-controlled directory
[iosapp, benchmark app] Remove remaining code for access token checking from app delegates
Feedback edits for @friedbunny
Diffstat (limited to 'platform/ios/app/MBXViewController.m')
-rw-r--r-- | platform/ios/app/MBXViewController.m | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index 1bd2b2f5b3..3335606f98 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -245,44 +245,17 @@ CLLocationCoordinate2D randomWorldCoordinate() { [self restoreState:nil]; - self.debugLoggingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsDebugLoggingEnabled"]; - self.mapView.showsScale = YES; - self.mapView.showsUserHeadingIndicator = YES; - self.mapView.experimental_enableFrameRateMeasurement = YES; - self.hudLabel.titleLabel.font = [UIFont monospacedDigitSystemFontOfSize:10 weight:UIFontWeightRegular]; - if ([MGLAccountManager accessToken].length) { self.styleIndex = -1; [self cycleStyles:self]; } - else - { - UIAlertController *alertController = [UIAlertController alertControllerWithTitle:@"Access Token" message:@"Enter your Mapbox access token to load Mapbox-hosted tiles and styles:" preferredStyle:UIAlertControllerStyleAlert]; - [alertController addTextFieldWithConfigurationHandler:^(UITextField * _Nonnull textField) - { - textField.keyboardType = UIKeyboardTypeURL; - textField.autocorrectionType = UITextAutocorrectionTypeNo; - textField.autocapitalizationType = UITextAutocapitalizationTypeNone; - }]; - - [alertController addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:nil]]; - UIAlertAction *OKAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) - { - UITextField *textField = alertController.textFields.firstObject; - NSString *accessToken = textField.text; - [[NSUserDefaults standardUserDefaults] setObject:accessToken forKey:MBXMapboxAccessTokenDefaultsKey]; - [MGLAccountManager setAccessToken:accessToken]; - - self.styleIndex = -1; - [self cycleStyles:self]; - [self.mapView reloadStyle:self]; - }]; - [alertController addAction:OKAction]; - alertController.preferredAction = OKAction; - [self presentViewController:alertController animated:YES completion:nil]; - } + self.debugLoggingEnabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"MGLMapboxMetricsDebugLoggingEnabled"]; + self.mapView.showsScale = YES; + self.mapView.showsUserHeadingIndicator = YES; + self.mapView.experimental_enableFrameRateMeasurement = YES; + self.hudLabel.titleLabel.font = [UIFont monospacedDigitSystemFontOfSize:10 weight:UIFontWeightRegular]; // Add fall-through single tap gesture recognizer. This will be called when // the map view's tap recognizers fail. |