Implemented persistant ETA, more views, better cancel buttons, etc.

This commit is contained in:
Max Hunt 2019-06-02 00:34:20 +01:00
parent 07eb910dfd
commit 2fed99218b
8 changed files with 413 additions and 23 deletions

View File

@ -8,6 +8,11 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
505AFEF8229FE1BD004FF0F1 /* settingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */; }; 505AFEF8229FE1BD004FF0F1 /* settingsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */; };
506421C522A339B7001E8877 /* xboth.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 506421C222A339B7001E8877 /* xboth.mp3 */; };
506421C622A339B7001E8877 /* xleft.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 506421C322A339B7001E8877 /* xleft.mp3 */; };
506421C722A339B7001E8877 /* xright.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 506421C422A339B7001E8877 /* xright.mp3 */; };
506421C922A33D87001E8877 /* InstructionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506421C822A33D87001E8877 /* InstructionsViewController.swift */; };
506421CD22A33EA5001E8877 /* TechSpecsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 506421CC22A33EA5001E8877 /* TechSpecsViewController.swift */; };
50A7ADD5229D6A4200D58743 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADD4229D6A4200D58743 /* AppDelegate.swift */; }; 50A7ADD5229D6A4200D58743 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADD4229D6A4200D58743 /* AppDelegate.swift */; };
50A7ADD7229D6A4200D58743 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADD6229D6A4200D58743 /* ViewController.swift */; }; 50A7ADD7229D6A4200D58743 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADD6229D6A4200D58743 /* ViewController.swift */; };
50A7ADDA229D6A4200D58743 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 50A7ADD8229D6A4200D58743 /* Main.storyboard */; }; 50A7ADDA229D6A4200D58743 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 50A7ADD8229D6A4200D58743 /* Main.storyboard */; };
@ -26,6 +31,11 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = settingsViewController.swift; sourceTree = "<group>"; }; 505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = settingsViewController.swift; sourceTree = "<group>"; };
506421C222A339B7001E8877 /* xboth.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = xboth.mp3; sourceTree = "<group>"; };
506421C322A339B7001E8877 /* xleft.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = xleft.mp3; sourceTree = "<group>"; };
506421C422A339B7001E8877 /* xright.mp3 */ = {isa = PBXFileReference; lastKnownFileType = audio.mp3; path = xright.mp3; sourceTree = "<group>"; };
506421C822A33D87001E8877 /* InstructionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstructionsViewController.swift; sourceTree = "<group>"; };
506421CC22A33EA5001E8877 /* TechSpecsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TechSpecsViewController.swift; sourceTree = "<group>"; };
50A7ADD1229D6A4200D58743 /* Guibe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Guibe.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50A7ADD1229D6A4200D58743 /* Guibe.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Guibe.app; sourceTree = BUILT_PRODUCTS_DIR; };
50A7ADD4229D6A4200D58743 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; }; 50A7ADD4229D6A4200D58743 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
50A7ADD6229D6A4200D58743 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; }; 50A7ADD6229D6A4200D58743 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
@ -77,6 +87,9 @@
50A7ADD3229D6A4200D58743 /* Guibe */ = { 50A7ADD3229D6A4200D58743 /* Guibe */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
506421C222A339B7001E8877 /* xboth.mp3 */,
506421C322A339B7001E8877 /* xleft.mp3 */,
506421C422A339B7001E8877 /* xright.mp3 */,
50A7AE05229D7B1E00D58743 /* Guibe.entitlements */, 50A7AE05229D7B1E00D58743 /* Guibe.entitlements */,
50A9B4E0229E115B00070F61 /* Video.mov */, 50A9B4E0229E115B00070F61 /* Video.mov */,
50A7ADD4229D6A4200D58743 /* AppDelegate.swift */, 50A7ADD4229D6A4200D58743 /* AppDelegate.swift */,
@ -84,9 +97,11 @@
50A7ADE6229D6C7100D58743 /* Assets.xcassets */, 50A7ADE6229D6C7100D58743 /* Assets.xcassets */,
50A7ADD8229D6A4200D58743 /* Main.storyboard */, 50A7ADD8229D6A4200D58743 /* Main.storyboard */,
50A7ADFE229D768900D58743 /* MainViewController.swift */, 50A7ADFE229D768900D58743 /* MainViewController.swift */,
505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */,
506421C822A33D87001E8877 /* InstructionsViewController.swift */,
506421CC22A33EA5001E8877 /* TechSpecsViewController.swift */,
50C69B1022A16A7100EA99C1 /* TableViewController.swift */, 50C69B1022A16A7100EA99C1 /* TableViewController.swift */,
50C69B1222A19D8800EA99C1 /* NewTableViewCell.swift */, 50C69B1222A19D8800EA99C1 /* NewTableViewCell.swift */,
505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */,
50A7ADFC229D766800D58743 /* 7_ReadyViewController.swift */, 50A7ADFC229D766800D58743 /* 7_ReadyViewController.swift */,
50A7ADF4229D75A900D58743 /* 3_StartViewController.swift */, 50A7ADF4229D75A900D58743 /* 3_StartViewController.swift */,
50A7ADF8229D75C100D58743 /* 5_HandChoiceViewController.swift */, 50A7ADF8229D75C100D58743 /* 5_HandChoiceViewController.swift */,
@ -178,9 +193,12 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
50A9B4E1229E115B00070F61 /* Video.mov in Resources */, 50A9B4E1229E115B00070F61 /* Video.mov in Resources */,
506421C522A339B7001E8877 /* xboth.mp3 in Resources */,
506421C622A339B7001E8877 /* xleft.mp3 in Resources */,
50A7ADDF229D6A4200D58743 /* LaunchScreen.storyboard in Resources */, 50A7ADDF229D6A4200D58743 /* LaunchScreen.storyboard in Resources */,
50A7ADE7229D6C7100D58743 /* Assets.xcassets in Resources */, 50A7ADE7229D6C7100D58743 /* Assets.xcassets in Resources */,
50A7ADDA229D6A4200D58743 /* Main.storyboard in Resources */, 50A7ADDA229D6A4200D58743 /* Main.storyboard in Resources */,
506421C722A339B7001E8877 /* xright.mp3 in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
@ -192,6 +210,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
50A7ADFD229D766800D58743 /* 7_ReadyViewController.swift in Sources */, 50A7ADFD229D766800D58743 /* 7_ReadyViewController.swift in Sources */,
506421CD22A33EA5001E8877 /* TechSpecsViewController.swift in Sources */,
50A7ADF9229D75C100D58743 /* 5_HandChoiceViewController.swift in Sources */, 50A7ADF9229D75C100D58743 /* 5_HandChoiceViewController.swift in Sources */,
50A7ADD7229D6A4200D58743 /* ViewController.swift in Sources */, 50A7ADD7229D6A4200D58743 /* ViewController.swift in Sources */,
50C69B1122A16A7100EA99C1 /* TableViewController.swift in Sources */, 50C69B1122A16A7100EA99C1 /* TableViewController.swift in Sources */,
@ -200,6 +219,7 @@
50C69B1322A19D8800EA99C1 /* NewTableViewCell.swift in Sources */, 50C69B1322A19D8800EA99C1 /* NewTableViewCell.swift in Sources */,
50A7ADFF229D768900D58743 /* MainViewController.swift in Sources */, 50A7ADFF229D768900D58743 /* MainViewController.swift in Sources */,
50A7ADFB229D75E900D58743 /* 6_SideChoiceViewController.swift in Sources */, 50A7ADFB229D75E900D58743 /* 6_SideChoiceViewController.swift in Sources */,
506421C922A33D87001E8877 /* InstructionsViewController.swift in Sources */,
505AFEF8229FE1BD004FF0F1 /* settingsViewController.swift in Sources */, 505AFEF8229FE1BD004FF0F1 /* settingsViewController.swift in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;

View File

@ -214,7 +214,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="barTintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="barTintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="yes" returnKeyType="go" enablesReturnKeyAutomatically="YES" smartInsertDeleteType="yes" textContentType="location"/> <textInputTraits key="textInputTraits" autocapitalizationType="words" autocorrectionType="yes" spellCheckingType="no" keyboardAppearance="alert" returnKeyType="go" enablesReturnKeyAutomatically="YES" smartInsertDeleteType="yes" textContentType="location"/>
</searchBar> </searchBar>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="G7y-oE-2AD"> <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="G7y-oE-2AD">
<rect key="frame" x="334" y="20" width="32" height="34"/> <rect key="frame" x="334" y="20" width="32" height="34"/>
@ -229,6 +229,17 @@
</subviews> </subviews>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="AjN-o6-SNx">
<rect key="frame" x="106" y="96" width="288" height="57"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="1" green="0.14913141730000001" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Cancel"/>
<connections>
<action selector="cancelBtnPressed:" destination="Ovf-sw-BKp" eventType="touchUpInside" id="SYj-U5-XBJ"/>
</connections>
</button>
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VZj-Lm-Ems" userLabel="menuView"> <view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="VZj-Lm-Ems" userLabel="menuView">
<rect key="frame" x="20" y="88" width="69" height="72"/> <rect key="frame" x="20" y="88" width="69" height="72"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@ -280,6 +291,11 @@
<state key="normal" title=" Instructions"> <state key="normal" title=" Instructions">
<color key="titleColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="titleColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state> </state>
<connections>
<segue destination="Obs-kC-EBO" kind="popoverPresentation" popoverAnchorView="sG4-j5-Aqw" id="nyG-Nf-0ng">
<popoverArrowDirection key="popoverArrowDirection" up="YES" down="YES" left="YES" right="YES"/>
</segue>
</connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xjP-IE-WTI"> <button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="xjP-IE-WTI">
<rect key="frame" x="53" y="326" width="277" height="56"/> <rect key="frame" x="53" y="326" width="277" height="56"/>
@ -288,6 +304,11 @@
<state key="normal" title=" Product Specifications"> <state key="normal" title=" Product Specifications">
<color key="titleColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="titleColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state> </state>
<connections>
<segue destination="fQI-eI-vgI" kind="popoverPresentation" popoverAnchorView="xjP-IE-WTI" id="Xzq-Av-xhq">
<popoverArrowDirection key="popoverArrowDirection" up="YES" down="YES" left="YES" right="YES"/>
</segue>
</connections>
</button> </button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="guibeWord" translatesAutoresizingMaskIntoConstraints="NO" id="90Y-ch-grn"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="guibeWord" translatesAutoresizingMaskIntoConstraints="NO" id="90Y-ch-grn">
<rect key="frame" x="119" y="90" width="114" height="47"/> <rect key="frame" x="119" y="90" width="114" height="47"/>
@ -300,20 +321,119 @@
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="9F2-yk-wzW">
<rect key="frame" x="364" y="853" width="30" height="31"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="52"/>
<state key="normal" title="^"/>
<connections>
<action selector="followBtnPressed:" destination="Ovf-sw-BKp" eventType="touchUpInside" id="pLx-Zt-hHP"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hPs-7x-Bl0">
<rect key="frame" x="20" y="809" width="39" height="75"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="52"/>
<state key="normal" title="^|"/>
<connections>
<action selector="headingBtnPressed:" destination="Ovf-sw-BKp" eventType="touchUpInside" id="ZlX-6a-RgF"/>
</connections>
</button>
<view alpha="0.0" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="wbi-cI-xnq" userLabel="etaView">
<rect key="frame" x="0.0" y="658" width="414" height="238"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ClP-uQ-1Va">
<rect key="frame" x="373" y="8" width="33" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="50"/>
<state key="normal" title="X"/>
<connections>
<action selector="xNaviPressed:" destination="Ovf-sw-BKp" eventType="touchUpInside" id="p7b-O5-4sQ"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vzP-jK-6zt">
<rect key="frame" x="131" y="148" width="152" height="48"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" red="0.29803921568627451" green="0.85098039215686272" blue="0.39215686274509803" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<fontDescription key="fontDescription" type="system" pointSize="30"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="Start"/>
<connections>
<action selector="startNaviPressed:" destination="Ovf-sw-BKp" eventType="touchUpInside" id="dRW-ul-LLy"/>
</connections>
</button>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="XXX" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumScaleFactor="0.20000000000000001" adjustsLetterSpacingToFitWidth="YES" translatesAutoresizingMaskIntoConstraints="NO" id="TUX-4j-j4B">
<rect key="frame" x="200" y="60" width="179" height="48"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="40"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="E. T. A." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="wNr-1M-KYL">
<rect key="frame" x="65" y="60" width="114" height="48"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="40"/>
<color key="textColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<view alpha="0.0" contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="BdX-f2-6nO">
<rect key="frame" x="87" y="823" width="240" height="42"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="E. T. A." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="nfu-Qy-9LC">
<rect key="frame" x="38" y="11" width="81" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="19"/>
<color key="textColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<color key="highlightedColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="XX:XX" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="O4h-DM-Zqh">
<rect key="frame" x="124" y="11" width="110" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="19"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="naviStartedImg" translatesAutoresizingMaskIntoConstraints="NO" id="zO0-ni-hEa">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Giw-Yg-RCh">
<rect key="frame" x="0.0" y="262" width="414" height="377"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<connections>
<action selector="keybDismissBtnPressed:" destination="Ovf-sw-BKp" eventType="touchUpInside" id="LM8-uw-rfe"/>
</connections>
</button>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="Ut7-03-t0b"/> <viewLayoutGuide key="safeArea" id="Ut7-03-t0b"/>
</view> </view>
<connections> <connections>
<outlet property="cancelBtn" destination="AjN-o6-SNx" id="oAt-yu-hp4"/>
<outlet property="dismissBtn" destination="efK-Gw-gxB" id="upX-k6-K16"/> <outlet property="dismissBtn" destination="efK-Gw-gxB" id="upX-k6-K16"/>
<outlet property="etaLabel" destination="TUX-4j-j4B" id="jfr-9U-oct"/>
<outlet property="etaView" destination="wbi-cI-xnq" id="pXR-sx-Wgh"/>
<outlet property="keybDismissBtn" destination="Giw-Yg-RCh" id="YE4-8g-jOa"/>
<outlet property="mapView" destination="Bex-Mk-DDO" id="2Ww-7N-bZc"/> <outlet property="mapView" destination="Bex-Mk-DDO" id="2Ww-7N-bZc"/>
<outlet property="menuBtn" destination="m8G-AJ-moq" id="QXG-rH-6Lm"/> <outlet property="menuBtn" destination="m8G-AJ-moq" id="QXG-rH-6Lm"/>
<outlet property="menuView" destination="VZj-Lm-Ems" id="IBs-mV-GJW"/> <outlet property="menuView" destination="VZj-Lm-Ems" id="IBs-mV-GJW"/>
<outlet property="menuWindowView" destination="J48-J9-3Mc" id="gnS-K2-H8d"/> <outlet property="menuWindowView" destination="J48-J9-3Mc" id="gnS-K2-H8d"/>
<outlet property="micBtn" destination="G7y-oE-2AD" id="W6R-nB-sax"/> <outlet property="micBtn" destination="G7y-oE-2AD" id="W6R-nB-sax"/>
<outlet property="persEtaLbl" destination="O4h-DM-Zqh" id="UYm-pC-87I"/>
<outlet property="persEtaView" destination="BdX-f2-6nO" id="4xT-MK-1za"/>
<outlet property="searchBar" destination="dRT-vj-1ew" id="nAa-5O-h0R"/> <outlet property="searchBar" destination="dRT-vj-1ew" id="nAa-5O-h0R"/>
<outlet property="searchBarBg" destination="3Xt-Rr-hs1" id="6bL-cK-ScI"/> <outlet property="searchBarBg" destination="3Xt-Rr-hs1" id="6bL-cK-ScI"/>
<outlet property="searchView" destination="bKl-Ku-mh1" id="d0n-Pl-NrK"/> <outlet property="searchView" destination="bKl-Ku-mh1" id="d0n-Pl-NrK"/>
<outlet property="startNaviBtn" destination="vzP-jK-6zt" id="pc2-d2-rNL"/>
<outlet property="startNaviImg" destination="zO0-ni-hEa" id="DY1-rU-X2g"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="a4w-SB-1GS" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="a4w-SB-1GS" userLabel="First Responder" sceneMemberID="firstResponder"/>
@ -484,6 +604,7 @@
<button opaque="NO" alpha="0.20000000000000001" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WPC-q8-Us8"> <button opaque="NO" alpha="0.20000000000000001" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="WPC-q8-Us8">
<rect key="frame" x="305" y="51" width="89" height="30"/> <rect key="frame" x="305" y="51" width="89" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<color key="tintColor" red="1" green="0.1748579502" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
<state key="normal" title="Reset Config"/> <state key="normal" title="Reset Config"/>
<connections> <connections>
<action selector="resetCfgPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="yTQ-3x-JnU"/> <action selector="resetCfgPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="yTQ-3x-JnU"/>
@ -504,6 +625,84 @@
</objects> </objects>
<point key="canvasLocation" x="1792.753623188406" y="776.78571428571422"/> <point key="canvasLocation" x="1792.753623188406" y="776.78571428571422"/>
</scene> </scene>
<!--Instructions View Controller-->
<scene sceneID="nhk-xq-GUM">
<objects>
<viewController id="Obs-kC-EBO" customClass="InstructionsViewController" customModule="Guibe" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="C7n-A7-fCY">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="tempFrame" translatesAutoresizingMaskIntoConstraints="NO" id="nrw-ke-kkD">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="serparator" translatesAutoresizingMaskIntoConstraints="NO" id="qeH-zn-8dI">
<rect key="frame" x="20" y="91" width="374" height="10"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="uJJ-lQ-GmO">
<rect key="frame" x="20" y="44" width="84" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="26"/>
<state key="normal" title="&lt; Back">
<color key="titleColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="backBtnPressed:" destination="Obs-kC-EBO" eventType="touchUpInside" id="7Ng-sC-CwS"/>
<action selector="backBtnPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="kji-Zz-O8P"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="qYW-KB-ok9"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="m3K-Fq-zFT" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="2686.9565217391305" y="776.78571428571422"/>
</scene>
<!--Tech Specs View Controller-->
<scene sceneID="VE5-Dr-0hF">
<objects>
<viewController id="fQI-eI-vgI" customClass="TechSpecsViewController" customModule="Guibe" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="qTR-ky-aoo">
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="serparator" translatesAutoresizingMaskIntoConstraints="NO" id="jLf-nt-C32">
<rect key="frame" x="20" y="91" width="374" height="10"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="EdV-MP-P7V">
<rect key="frame" x="20" y="44" width="84" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="26"/>
<state key="normal" title="&lt; Back">
<color key="titleColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="backBtnPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="xJ3-9L-xKa"/>
<action selector="goBackPressed:" destination="fQI-eI-vgI" eventType="touchUpInside" id="KBk-sp-9QO"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="left" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="h0z-eh-4QL">
<rect key="frame" x="69" y="109" width="277" height="56"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" name="Helvetica" family="Helvetica" pointSize="25"/>
<state key="normal" title=" Product Specifications">
<color key="titleColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
</button>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="ipt-6K-zfd"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="wSV-AY-vef" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3603" y="777"/>
</scene>
</scenes> </scenes>
<resources> <resources>
<image name="LoadScreen" width="294.66665649414062" height="638"/> <image name="LoadScreen" width="294.66665649414062" height="638"/>
@ -512,6 +711,7 @@
<image name="circle" width="575.33331298828125" height="568.33331298828125"/> <image name="circle" width="575.33331298828125" height="568.33331298828125"/>
<image name="guibeWord" width="250.66667175292969" height="100"/> <image name="guibeWord" width="250.66667175292969" height="100"/>
<image name="menuBtnImg" width="341.33334350585938" height="341.33334350585938"/> <image name="menuBtnImg" width="341.33334350585938" height="341.33334350585938"/>
<image name="naviStartedImg" width="386" height="838.66668701171875"/>
<image name="nextBtn" width="495.33334350585938" height="181.33332824707031"/> <image name="nextBtn" width="495.33334350585938" height="181.33332824707031"/>
<image name="playAgainBtn" width="596.66668701171875" height="229.33332824707031"/> <image name="playAgainBtn" width="596.66668701171875" height="229.33332824707031"/>
<image name="s1l" width="167.33332824707031" height="199.33332824707031"/> <image name="s1l" width="167.33332824707031" height="199.33332824707031"/>
@ -526,6 +726,7 @@
<image name="speechBtn" width="331.33334350585938" height="369"/> <image name="speechBtn" width="331.33334350585938" height="369"/>
<image name="startBtn" width="173.33332824707031" height="47.666667938232422"/> <image name="startBtn" width="173.33332824707031" height="47.666667938232422"/>
<image name="startScreen" width="306" height="661.33331298828125"/> <image name="startScreen" width="306" height="661.33331298828125"/>
<image name="tempFrame" width="399.33334350585938" height="868"/>
<image name="welcome2Screen" width="293.33334350585938" height="636"/> <image name="welcome2Screen" width="293.33334350585938" height="636"/>
</resources> </resources>
</document> </document>

View File

@ -0,0 +1,34 @@
//
// InstructionsViewController.swift
// Guibe
//
// Created by Max Hunt on 02/06/2019.
// Copyright © 2019 8. All rights reserved.
//
import UIKit
class InstructionsViewController: UIViewController {
@IBAction func backBtnPressed(_ sender: Any) {
self.dismiss(animated: true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}

View File

@ -22,6 +22,7 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol {
let appDelegate = UIApplication.shared.delegate as! AppDelegate let appDelegate = UIApplication.shared.delegate as! AppDelegate
var etaTime: Int = -1
let locationManager = CLLocationManager() let locationManager = CLLocationManager()
var currentCoordinate: CLLocationCoordinate2D! var currentCoordinate: CLLocationCoordinate2D!
@ -37,6 +38,7 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol {
var startedNavigation: Bool = false var startedNavigation: Bool = false
// OUTLETS--------------OUTLETS // OUTLETS--------------OUTLETS
@IBOutlet weak var menuWindowView: UIView! @IBOutlet weak var menuWindowView: UIView!
@IBOutlet weak var menuView: UIView! @IBOutlet weak var menuView: UIView!
@ -47,9 +49,20 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol {
@IBOutlet weak var searchView: UIView! @IBOutlet weak var searchView: UIView!
@IBOutlet weak var searchBar: UISearchBar! @IBOutlet weak var searchBar: UISearchBar!
@IBOutlet weak var micBtn: UIButton! @IBOutlet weak var micBtn: UIButton!
@IBOutlet weak var keybDismissBtn: UIButton!
// --------------------- // ---------------------
@IBOutlet weak var mapView: MKMapView! @IBOutlet weak var mapView: MKMapView!
// OUTLETS--------------OUTLETS // ---------------------
@IBOutlet weak var etaView: UIView!
@IBOutlet weak var startNaviBtn: UIButton!
@IBOutlet weak var etaLabel: UILabel!
@IBOutlet weak var startNaviImg: UIImageView!
// ---------------------
@IBOutlet weak var cancelBtn: UIButton!
// ---------------------
@IBOutlet weak var persEtaView: UIView!
@IBOutlet weak var persEtaLbl: UILabel!
// OUTLETS--------------OUTLETS
// ACTIONS--------------ACTIONS // ACTIONS--------------ACTIONS
@IBAction func menuBtnPressed(_ sender: Any) { @IBAction func menuBtnPressed(_ sender: Any) {
@ -64,7 +77,53 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol {
} }
@IBAction func settingsBtnPressed(_ sender: Any) { @IBAction func settingsBtnPressed(_ sender: Any) {
} }
// ACTIONS--------------ACTIONS @IBAction func followBtnPressed(_ sender: Any) {
self.mapView.userTrackingMode = .follow
}
@IBAction func headingBtnPressed(_ sender: Any) {
self.mapView.userTrackingMode = .followWithHeading
}
// --------------------------
@IBAction func startNaviPressed(_ sender: Any) {
self.startedNavigation = true
self.stepCounter += 1
DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
self.searchBar.text = ""
self.etaView.alpha = 0.0
self.searchView.alpha = 0.0
self.cancelBtn.alpha = 1.0
self.persEtaView.alpha = 1.0
}
UIView.animate(withDuration: 0.5, animations: {self.startNaviImg.alpha = 1.0})
DispatchQueue.main.asyncAfter(deadline: .now() + 3) {
UIView.animate(withDuration: 0.5, animations: {self.startNaviImg.alpha = 0.0})
}
}
@IBAction func xNaviPressed(_ sender: Any) {
UIView.animate(withDuration: 0.5, animations: {self.etaView.alpha = 0.0})
mapView.removeOverlays(mapView.overlays)
}
@IBAction func cancelBtnPressed(_ sender: Any) {
self.stepCounter = 0
self.startedNavigation = false
mapView.removeOverlays(mapView.overlays)
UIView.animate(withDuration: 0.3, animations: {
self.searchView.alpha = 1.0
self.cancelBtn.alpha = 0.0
self.persEtaView.alpha = 0.0
})
}
@IBAction func keybDismissBtnPressed(_ sender: Any) {
searchBar.endEditing(true)
self.keybDismissBtn.isHidden = true
}
// --------------------------
// ACTIONS--------------ACTIONS
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
@ -75,19 +134,52 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol {
searchBarBg.layer.shadowRadius = 10 searchBarBg.layer.shadowRadius = 10
searchBarBg.layer.shadowOpacity = 0.2 searchBarBg.layer.shadowOpacity = 0.2
keybDismissBtn.isHidden = true
menuWindowView.alpha = 0.0
menuWindowView.layer.shadowColor = UIColor.black.cgColor menuWindowView.layer.shadowColor = UIColor.black.cgColor
menuWindowView.layer.cornerRadius = 13 menuWindowView.layer.cornerRadius = 13
menuWindowView.layer.shadowOffset = CGSize(width: 5, height: 7) menuWindowView.layer.shadowOffset = CGSize(width: 5, height: 7)
menuWindowView.layer.shadowRadius = 10 menuWindowView.layer.shadowRadius = 10
menuWindowView.layer.shadowOpacity = 0.2 menuWindowView.layer.shadowOpacity = 0.2
dismissBtn.isHidden = true
mapView.delegate = self mapView.delegate = self
etaView.alpha = 0.0
etaView.layer.shadowColor = UIColor.black.cgColor
etaView.layer.shadowOffset = CGSize(width: 0, height: -10)
etaView.layer.shadowRadius = 10
etaView.layer.shadowOpacity = 0.2
cancelBtn.alpha = 0.0
// cancelBtn.isHidden = true
cancelBtn.layer.shadowColor = UIColor.black.cgColor
cancelBtn.layer.cornerRadius = 15
cancelBtn.layer.shadowOffset = CGSize(width: 3, height: 6)
cancelBtn.layer.shadowRadius = 10
cancelBtn.layer.shadowOpacity = 0.2
startNaviBtn.layer.shadowColor = UIColor.black.cgColor
startNaviBtn.layer.cornerRadius = 13
startNaviBtn.layer.shadowOffset = CGSize(width: 5, height: 7)
startNaviBtn.layer.shadowRadius = 10
startNaviBtn.layer.shadowOpacity = 0.2
locationManager.delegate = self locationManager.delegate = self
locationManager.desiredAccuracy = kCLLocationAccuracyBest locationManager.desiredAccuracy = kCLLocationAccuracyBest
locationManager.startUpdatingLocation() locationManager.startUpdatingLocation()
mapView.userTrackingMode = .follow
startNaviImg.alpha = 0.0
persEtaView.alpha = 0.0
persEtaView.layer.shadowColor = UIColor.black.cgColor
persEtaView.layer.cornerRadius = 7
persEtaView.layer.shadowOffset = CGSize(width: 5, height: 7)
persEtaView.layer.shadowRadius = 7
persEtaView.layer.shadowOpacity = 0.2
} //END OF VIEW DID LOAD } //END OF VIEW DID LOAD
@ -105,19 +197,19 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol {
directions.calculate { (response, _) in directions.calculate { (response, _) in
guard let response = response else { return } guard let response = response else { return }
// self.appDelegate.navigationResults = response
// let resultsViewController = self.storyboard?.instantiateViewController(withIdentifier: "resultsScreen") as! TableViewController
// resultsViewController.searchResults = response
// resultsViewController.modalTransitionStyle = .coverVertical
// self.present(resultsViewController, animated: true, completion: nil)
guard let primaryRoute = response.routes.first else { return } guard let primaryRoute = response.routes.first else { return }
self.mapView.addOverlay(primaryRoute.polyline) self.mapView.addOverlay(primaryRoute.polyline)
// directions.calculateETA { (etaResponse, error) -> Void in
// if let error = error {
// print("Error while requesting ETA : \(error.localizedDescription)")
// //travelTime = "Not Available"
// }else{
// self.etaMinutes = Int((etaResponse?.expectedTravelTime)!/60)
// }
// }
self.steps = primaryRoute.steps self.steps = primaryRoute.steps
for i in 0 ..< primaryRoute.steps.count { for i in 0 ..< primaryRoute.steps.count {
let step = primaryRoute.steps[i] let step = primaryRoute.steps[i]
@ -133,8 +225,19 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol {
self.mapView.addOverlay(circle) self.mapView.addOverlay(circle)
} }
self.startedNavigation = true let travelTime = Int(primaryRoute.expectedTravelTime/60)
self.stepCounter += 1 // let x = DateFormatter.localizedString(from: NSDate() as Date, dateStyle: DateFormatter.Style.none, timeStyle: DateFormatter.Style.short)
let startDate = Date()
let ETATime = startDate.addingTimeInterval(TimeInterval(travelTime*60))
let ETAVarLbl = DateFormatter.localizedString(from: ETATime, dateStyle: DateFormatter.Style.none, timeStyle: DateFormatter.Style.short)
self.etaLabel.text = "\(ETAVarLbl)"
self.persEtaLbl.text = "\(ETAVarLbl)"
UIView.animate(withDuration: 0.3, animations: {self.etaView.alpha = 1.0})
// self.startedNavigation = true
// self.stepCounter += 1
} }
} }
@ -149,7 +252,7 @@ extension MainViewController: CLLocationManagerDelegate {
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
guard let currentLocation = locations.first else { return } guard let currentLocation = locations.first else { return }
currentCoordinate = currentLocation.coordinate currentCoordinate = currentLocation.coordinate
mapView.userTrackingMode = .follow
if startedNavigation == true { if startedNavigation == true {
let nextStep = steps[stepCounter] let nextStep = steps[stepCounter]
@ -256,6 +359,7 @@ extension MainViewController: CLLocationManagerDelegate {
extension MainViewController: UISearchBarDelegate { extension MainViewController: UISearchBarDelegate {
func searchBarSearchButtonClicked(_ searchBar: UISearchBar) { func searchBarSearchButtonClicked(_ searchBar: UISearchBar) {
searchBar.endEditing(true) //HIDES LE KEYBOARD searchBar.endEditing(true) //HIDES LE KEYBOARD
self.keybDismissBtn.isHidden = true
let localSearchRequest = MKLocalSearch.Request() let localSearchRequest = MKLocalSearch.Request()
localSearchRequest.naturalLanguageQuery = searchBar.text localSearchRequest.naturalLanguageQuery = searchBar.text
@ -272,13 +376,10 @@ extension MainViewController: UISearchBarDelegate {
resultsViewController.modalTransitionStyle = .coverVertical resultsViewController.modalTransitionStyle = .coverVertical
resultsViewController.myProtocol = self resultsViewController.myProtocol = self
self.present(resultsViewController, animated: true, completion: nil) self.present(resultsViewController, animated: true, completion: nil)
// guard let firstMapItem = response.mapItems.first else { return }
// self.getDirections(to: firstMapItem)
} }
}
func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
self.keybDismissBtn.isHidden = false
} }
} }
extension MainViewController: MKMapViewDelegate { extension MainViewController: MKMapViewDelegate {

View File

@ -0,0 +1,34 @@
//
// TechSpecsViewController.swift
// Guibe
//
// Created by Max Hunt on 02/06/2019.
// Copyright © 2019 8. All rights reserved.
//
import UIKit
class TechSpecsViewController: UIViewController {
@IBAction func goBackPressed(_ sender: Any) {
self.dismiss(animated: true, completion: nil)
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}

BIN
Guibe/xboth.mp3 Normal file

Binary file not shown.

BIN
Guibe/xleft.mp3 Normal file

Binary file not shown.

BIN
Guibe/xright.mp3 Normal file

Binary file not shown.