diff options
author | Justin R. Miller <incanus@codesorcery.net> | 2017-05-25 10:59:10 -0700 |
---|---|---|
committer | Justin R. Miller <incanus@codesorcery.net> | 2017-05-25 10:59:10 -0700 |
commit | 537355e16da43f38c3678b72d4bc265cf2883753 (patch) | |
tree | 7a77a5f29da63962dca933083f09fe26142d2ba5 /platform/ios/app | |
parent | fce7747da099519d8e29eff4befc5c205048492a (diff) | |
download | qtlocation-mapboxgl-upstream/9096-debug.tar.gz |
pairing debug codeupstream/9096-debug
Diffstat (limited to 'platform/ios/app')
-rw-r--r-- | platform/ios/app/MBXTestViewController.h | 13 | ||||
-rw-r--r-- | platform/ios/app/MBXTestViewController.m | 50 | ||||
-rw-r--r-- | platform/ios/app/MBXViewController.m | 29 |
3 files changed, 92 insertions, 0 deletions
diff --git a/platform/ios/app/MBXTestViewController.h b/platform/ios/app/MBXTestViewController.h new file mode 100644 index 0000000000..11a43ab315 --- /dev/null +++ b/platform/ios/app/MBXTestViewController.h @@ -0,0 +1,13 @@ +// +// MBXTestViewController.h +// ios +// +// Created by Justin R. Miller on 5/25/17. +// Copyright © 2017 Mapbox. All rights reserved. +// + +#import <UIKit/UIKit.h> + +@interface MBXTestViewController : UIViewController + +@end diff --git a/platform/ios/app/MBXTestViewController.m b/platform/ios/app/MBXTestViewController.m new file mode 100644 index 0000000000..c664e9804b --- /dev/null +++ b/platform/ios/app/MBXTestViewController.m @@ -0,0 +1,50 @@ +// +// MBXTestViewController.m +// ios +// +// Created by Justin R. Miller on 5/25/17. +// Copyright © 2017 Mapbox. All rights reserved. +// + +#import "MBXTestViewController.h" + +#import <Mapbox/Mapbox.h> + +@interface MBXTestViewController () + +@property (nonatomic) MGLMapView *mapView; + +@end + +@implementation MBXTestViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + self.mapView = [[MGLMapView alloc] initWithFrame:self.view.bounds styleURL:[MGLStyle darkStyleURLWithVersion:9]]; + [self.view addSubview:self.mapView]; + + NSLog(@"new map view: %p", self.mapView); + +// [self.mapView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)]]; +// +// double lat = 0; +// double lon = 0; +// NSMutableArray *annotations = [NSMutableArray array]; +// for (int i = 0; i < 10; i++) +// { +// MGLPointAnnotation *a = [MGLPointAnnotation new]; +// a.coordinate = CLLocationCoordinate2DMake(lat, lon); +// [annotations addObject:a]; +// lat += 5; +// lon += 10; +// } +// [self.mapView addAnnotations:annotations]; +} + +- (void)handleTap:(UITapGestureRecognizer *)tap +{ + self.navigationController.navigationBarHidden = !self.navigationController.navigationBarHidden; +} + +@end diff --git a/platform/ios/app/MBXViewController.m b/platform/ios/app/MBXViewController.m index d3927374a7..ccdac626ab 100644 --- a/platform/ios/app/MBXViewController.m +++ b/platform/ios/app/MBXViewController.m @@ -7,6 +7,8 @@ #import "MBXUserLocationAnnotationView.h" #import "MBXEmbeddedMapViewController.h" +#import "MBXTestViewController.h" + #import <Mapbox/Mapbox.h> #import <objc/runtime.h> @@ -148,10 +150,37 @@ typedef NS_ENUM(NSInteger, MBXSettingsMiscellaneousRows) { } } +- (void)present +{ + MBXTestViewController *vc = [[MBXTestViewController alloc] initWithNibName:nil bundle:nil]; +// UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; +// vc.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Dismiss" style:UIBarButtonItemStyleDone target:self action:@selector(dismiss)]; + [self presentViewController:/*nav*/vc animated:YES completion:nil]; + + [self performSelector:@selector(dismiss) withObject:nil afterDelay:2]; +} + +- (void)dismiss +{ + [self dismissViewControllerAnimated:YES completion:nil]; +} + - (void)viewDidLoad { [super viewDidLoad]; + + [self performSelector:@selector(present) withObject:nil afterDelay:2]; + + + + return; + + + + + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(saveState:) name:UIApplicationDidEnterBackgroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(restoreState:) name:UIApplicationWillEnterForegroundNotification object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(saveState:) name:UIApplicationWillTerminateNotification object:nil]; |