diff options
author | Nadia Barbosa <nadiabarbosa@me.com> | 2019-03-29 15:31:15 -0700 |
---|---|---|
committer | Nadia Barbosa <nadiabarbosa@me.com> | 2019-03-29 15:31:15 -0700 |
commit | 8a688c1d2617ecfc2f8ea3e5fc6ce1eced35b48c (patch) | |
tree | 9c86c88294ef9b5481cc2f1c2afb9b341f10ccfc | |
parent | bc952b9fcdfbec75b3b36327a80f3cf5bc5f88b7 (diff) | |
download | qtlocation-mapboxgl-8a688c1d2617ecfc2f8ea3e5fc6ce1eced35b48c.tar.gz |
Programatically switch between tab bar items at ⚡️LIGHTNING SPEED ⚡️
-rw-r--r-- | platform/ios/app/Info.plist | 2 | ||||
-rw-r--r-- | platform/ios/app/MBXTabBarViewController.h | 9 | ||||
-rw-r--r-- | platform/ios/app/MBXTabBarViewController.m | 19 | ||||
-rw-r--r-- | platform/ios/app/Main.storyboard | 11 | ||||
-rw-r--r-- | platform/ios/ios.xcodeproj/project.pbxproj | 26 |
5 files changed, 56 insertions, 11 deletions
diff --git a/platform/ios/app/Info.plist b/platform/ios/app/Info.plist index e2f294a5a5..d66de98b89 100644 --- a/platform/ios/app/Info.plist +++ b/platform/ios/app/Info.plist @@ -2,6 +2,8 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> + <key>MGLMapboxAccessToken</key> + <string>pk.eyJ1IjoibmJiMTI4MDUiLCJhIjoiY2p0dWs1enYwMHUyMDRlbXBzZjl1cm1kbyJ9.L-RLmtbUQ-xuo3cpTIKjRQ</string> <key>CFBundleDevelopmentRegion</key> <string>en</string> <key>CFBundleDisplayName</key> diff --git a/platform/ios/app/MBXTabBarViewController.h b/platform/ios/app/MBXTabBarViewController.h new file mode 100644 index 0000000000..1727498b80 --- /dev/null +++ b/platform/ios/app/MBXTabBarViewController.h @@ -0,0 +1,9 @@ +#import <UIKit/UIKit.h> + +NS_ASSUME_NONNULL_BEGIN + +@interface MBXTabBarViewController : UITabBarController + +@end + +NS_ASSUME_NONNULL_END diff --git a/platform/ios/app/MBXTabBarViewController.m b/platform/ios/app/MBXTabBarViewController.m new file mode 100644 index 0000000000..cfd3571a2b --- /dev/null +++ b/platform/ios/app/MBXTabBarViewController.m @@ -0,0 +1,19 @@ +#import "MBXTabBarViewController.h" + +@interface MBXTabBarViewController () + +@property (strong) NSTimer *repeatingTimer; + +@end + +@implementation MBXTabBarViewController + +- (void)viewDidLoad { + [super viewDidLoad]; + + _repeatingTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 repeats:YES block:^(NSTimer * _Nonnull timer) { + self.selectedIndex = self.selectedIndex == 1 ? 0 : 1; + }]; +} + +@end diff --git a/platform/ios/app/Main.storyboard b/platform/ios/app/Main.storyboard index 3fa567d0c5..145f033941 100644 --- a/platform/ios/app/Main.storyboard +++ b/platform/ios/app/Main.storyboard @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="UTF-8"?> -<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="6NY-cY-yee"> +<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14460.31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="6NY-cY-yee"> <device id="retina4_7" orientation="portrait"> <adaptation id="fullscreen"/> </device> <dependencies> <deployment identifier="iOS"/> - <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14490.49"/> + <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14460.20"/> <capability name="Safe area layout guides" minToolsVersion="9.0"/> <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> </dependencies> @@ -86,7 +86,7 @@ </connections> </barButtonItem> <button key="titleView" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" id="KsN-ny-Hou"> - <rect key="frame" x="72" y="5.5" width="203" height="33"/> + <rect key="frame" x="65" y="5.5" width="203" height="33"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <fontDescription key="fontDescription" type="system" weight="medium" pointSize="17"/> <state key="normal" title="Streets"/> @@ -491,12 +491,13 @@ </objects> <point key="canvasLocation" x="2073" y="1082"/> </scene> - <!--Tab Bar Controller--> + <!--Tab Bar View Controller--> <scene sceneID="61A-V2-Qxo"> <objects> - <tabBarController automaticallyAdjustsScrollViewInsets="NO" id="6NY-cY-yee" sceneMemberID="viewController"> + <tabBarController automaticallyAdjustsScrollViewInsets="NO" id="6NY-cY-yee" customClass="MBXTabBarViewController" sceneMemberID="viewController"> <toolbarItems/> <tabBar key="tabBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="X23-9Z-dhh"> + <rect key="frame" x="0.0" y="0.0" width="1000" height="1000"/> <autoresizingMask key="autoresizingMask"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> </tabBar> diff --git a/platform/ios/ios.xcodeproj/project.pbxproj b/platform/ios/ios.xcodeproj/project.pbxproj index 330b28377b..0c8f192717 100644 --- a/platform/ios/ios.xcodeproj/project.pbxproj +++ b/platform/ios/ios.xcodeproj/project.pbxproj @@ -15,6 +15,7 @@ 076171C32139C70900668A35 /* MGLMapViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 076171C22139C70900668A35 /* MGLMapViewTests.m */; }; 076171C72141A91700668A35 /* Settings.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 076171C62141A91700668A35 /* Settings.bundle */; }; 077061DA215DA00E000FEF62 /* MGLTestLocationManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 077061D9215DA00E000FEF62 /* MGLTestLocationManager.m */; }; + 0770C476224EC60100F9916E /* MBXTabBarViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 0770C475224EC60100F9916E /* MBXTabBarViewController.m */; }; 0778DD431F67556700A73B34 /* MGLComputedShapeSource.h in Headers */ = {isa = PBXBuildFile; fileRef = 0778DD401F67555F00A73B34 /* MGLComputedShapeSource.h */; settings = {ATTRIBUTES = (Public, ); }; }; 0778DD441F67556C00A73B34 /* MGLComputedShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0778DD411F67555F00A73B34 /* MGLComputedShapeSource.mm */; }; 07D8C6FB1F67560100381808 /* MGLComputedShapeSource.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0778DD411F67555F00A73B34 /* MGLComputedShapeSource.mm */; }; @@ -848,6 +849,8 @@ 076171C62141A91700668A35 /* Settings.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = Settings.bundle; path = app/Settings.bundle; sourceTree = SOURCE_ROOT; }; 077061D9215DA00E000FEF62 /* MGLTestLocationManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MGLTestLocationManager.m; sourceTree = "<group>"; }; 077061DB215DA11F000FEF62 /* MGLTestLocationManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MGLTestLocationManager.h; sourceTree = "<group>"; }; + 0770C474224EC60100F9916E /* MBXTabBarViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MBXTabBarViewController.h; sourceTree = "<group>"; }; + 0770C475224EC60100F9916E /* MBXTabBarViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MBXTabBarViewController.m; sourceTree = "<group>"; }; 0778DD401F67555F00A73B34 /* MGLComputedShapeSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MGLComputedShapeSource.h; sourceTree = "<group>"; }; 0778DD411F67555F00A73B34 /* MGLComputedShapeSource.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MGLComputedShapeSource.mm; sourceTree = "<group>"; }; 07D8C6FD1F67562800381808 /* MGLComputedShapeSourceTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MGLComputedShapeSourceTests.m; path = ../../darwin/test/MGLComputedShapeSourceTests.m; sourceTree = "<group>"; }; @@ -1506,6 +1509,17 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 0770C473224EC58B00F9916E /* debug */ = { + isa = PBXGroup; + children = ( + A4F36CDB224C1A94001B520C /* MBXTestViewController.h */, + A4F36CDC224C1A94001B520C /* MBXTestViewController.m */, + 0770C474224EC60100F9916E /* MBXTabBarViewController.h */, + 0770C475224EC60100F9916E /* MBXTabBarViewController.m */, + ); + name = debug; + sourceTree = "<group>"; + }; 16376B081FFD9DAF0000563E /* Integration Tests */ = { isa = PBXGroup; children = ( @@ -1947,6 +1961,7 @@ DA1DC94C1CB6C1C2006E619F /* Demo App */ = { isa = PBXGroup; children = ( + 0770C473224EC58B00F9916E /* debug */, 3E6465D52065767A00685536 /* LimeGreenStyleLayer.h */, 3E6465D42065767A00685536 /* LimeGreenStyleLayer.m */, DA1DC9501CB6C1C2006E619F /* MBXAppDelegate.h */, @@ -1970,8 +1985,6 @@ 632281DD1E6F855900D75A5D /* MBXEmbeddedMapViewController.h */, 632281DE1E6F855900D75A5D /* MBXEmbeddedMapViewController.m */, 6FA9341621EF372100AA9CA8 /* MBXOrnamentsViewController.h */, - A4F36CDB224C1A94001B520C /* MBXTestViewController.h */, - A4F36CDC224C1A94001B520C /* MBXTestViewController.m */, 6FA9341521EF372100AA9CA8 /* MBXOrnamentsViewController.m */, DA821D051CCC6D59007508D4 /* Main.storyboard */, DA821D041CCC6D59007508D4 /* LaunchScreen.storyboard */, @@ -2911,7 +2924,7 @@ }; DA1DC9491CB6C1C2006E619F = { CreatedOnToolsVersion = 7.3; - DevelopmentTeam = 85826LGZGV; + DevelopmentTeam = GJZR2MEM28; LastSwiftMigration = 0820; }; DA2E88501CC036F400F24E7B = { @@ -3114,6 +3127,7 @@ 6FA9341721EF372100AA9CA8 /* MBXOrnamentsViewController.m in Sources */, DA1DC96B1CB6C6B7006E619F /* MBXOfflinePacksTableViewController.m in Sources */, A4F36CDD224C1A94001B520C /* MBXTestViewController.m in Sources */, + 0770C476224EC60100F9916E /* MBXTabBarViewController.m in Sources */, DA1DC96A1CB6C6B7006E619F /* MBXCustomCalloutView.m in Sources */, 927FBCFC1F4DAA8300F8BF1F /* MBXSnapshotsViewController.m in Sources */, DA1DC99B1CB6E064006E619F /* MBXViewController.m in Sources */, @@ -3838,7 +3852,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 85826LGZGV; + DEVELOPMENT_TEAM = GJZR2MEM28; INFOPLIST_FILE = "$(SRCROOT)/app/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL432; @@ -4167,7 +4181,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 85826LGZGV; + DEVELOPMENT_TEAM = GJZR2MEM28; INFOPLIST_FILE = "$(SRCROOT)/app/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL432; @@ -4180,7 +4194,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - DEVELOPMENT_TEAM = 85826LGZGV; + DEVELOPMENT_TEAM = GJZR2MEM28; INFOPLIST_FILE = "$(SRCROOT)/app/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.mapbox.MapboxGL432; |