added stepBySteps written view
This commit is contained in:
parent
081f7d1158
commit
f0e5a9c5a3
@ -25,6 +25,8 @@
|
||||
50A7ADFF229D768900D58743 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADFE229D768900D58743 /* MainViewController.swift */; };
|
||||
50A7AE02229D7B1100D58743 /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50A7AE01229D7B1100D58743 /* MapKit.framework */; };
|
||||
50A9B4E1229E115B00070F61 /* Video.mov in Resources */ = {isa = PBXBuildFile; fileRef = 50A9B4E0229E115B00070F61 /* Video.mov */; };
|
||||
50B1485C22A46EBD008B16AF /* WrittenInstructionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B1485B22A46EBD008B16AF /* WrittenInstructionsViewController.swift */; };
|
||||
50B1485E22A46F7A008B16AF /* VideoInstrictionsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50B1485D22A46F7A008B16AF /* VideoInstrictionsViewController.swift */; };
|
||||
50C69B1122A16A7100EA99C1 /* TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50C69B1022A16A7100EA99C1 /* TableViewController.swift */; };
|
||||
50C69B1322A19D8800EA99C1 /* NewTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50C69B1222A19D8800EA99C1 /* NewTableViewCell.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
@ -51,6 +53,8 @@
|
||||
50A7AE01229D7B1100D58743 /* MapKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MapKit.framework; path = System/Library/Frameworks/MapKit.framework; sourceTree = SDKROOT; };
|
||||
50A7AE05229D7B1E00D58743 /* Guibe.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Guibe.entitlements; sourceTree = "<group>"; };
|
||||
50A9B4E0229E115B00070F61 /* Video.mov */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = Video.mov; sourceTree = "<group>"; };
|
||||
50B1485B22A46EBD008B16AF /* WrittenInstructionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WrittenInstructionsViewController.swift; sourceTree = "<group>"; };
|
||||
50B1485D22A46F7A008B16AF /* VideoInstrictionsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoInstrictionsViewController.swift; sourceTree = "<group>"; };
|
||||
50C69B1022A16A7100EA99C1 /* TableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TableViewController.swift; sourceTree = "<group>"; };
|
||||
50C69B1222A19D8800EA99C1 /* NewTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTableViewCell.swift; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
@ -96,6 +100,8 @@
|
||||
50A7ADD6229D6A4200D58743 /* ViewController.swift */,
|
||||
50A7ADE6229D6C7100D58743 /* Assets.xcassets */,
|
||||
50A7ADD8229D6A4200D58743 /* Main.storyboard */,
|
||||
50B1485D22A46F7A008B16AF /* VideoInstrictionsViewController.swift */,
|
||||
50B1485B22A46EBD008B16AF /* WrittenInstructionsViewController.swift */,
|
||||
50A7ADFE229D768900D58743 /* MainViewController.swift */,
|
||||
505AFEF7229FE1BD004FF0F1 /* settingsViewController.swift */,
|
||||
506421C822A33D87001E8877 /* InstructionsViewController.swift */,
|
||||
@ -212,6 +218,8 @@
|
||||
50A7ADFD229D766800D58743 /* 7_ReadyViewController.swift in Sources */,
|
||||
506421CD22A33EA5001E8877 /* TechSpecsViewController.swift in Sources */,
|
||||
50A7ADF9229D75C100D58743 /* 5_HandChoiceViewController.swift in Sources */,
|
||||
50B1485E22A46F7A008B16AF /* VideoInstrictionsViewController.swift in Sources */,
|
||||
50B1485C22A46EBD008B16AF /* WrittenInstructionsViewController.swift in Sources */,
|
||||
50A7ADD7229D6A4200D58743 /* ViewController.swift in Sources */,
|
||||
50C69B1122A16A7100EA99C1 /* TableViewController.swift in Sources */,
|
||||
50A7ADF5229D75A900D58743 /* 3_StartViewController.swift in Sources */,
|
||||
|
||||
@ -14,7 +14,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
||||
|
||||
var window: UIWindow?
|
||||
|
||||
var navigationResults: MKDirections.Response?
|
||||
var textSteps: [MKRoute.Step]?
|
||||
var currentStep: Int = 0
|
||||
|
||||
|
||||
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
|
||||
|
||||
@ -628,15 +628,11 @@
|
||||
<!--Instructions View Controller-->
|
||||
<scene sceneID="nhk-xq-GUM">
|
||||
<objects>
|
||||
<viewController id="Obs-kC-EBO" customClass="InstructionsViewController" customModule="Guibe" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<viewController storyboardIdentifier="ivc" useStoryboardIdentifierAsRestorationIdentifier="YES" 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"/>
|
||||
@ -653,6 +649,39 @@
|
||||
<action selector="backBtnPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="kji-Zz-O8P"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZS9-iD-Y8a">
|
||||
<rect key="frame" x="29" y="148" width="177" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="32"/>
|
||||
<state key="normal" title="Video/ Audio">
|
||||
<color key="titleColor" cocoaTouchSystemColor="scrollViewTexturedBackgroundColor"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="VABtnPressed:" destination="Obs-kC-EBO" eventType="touchUpInside" id="IKd-L7-0DM"/>
|
||||
<segue destination="Z1d-IC-mUl" kind="popoverPresentation" popoverAnchorView="ZS9-iD-Y8a" id="cOj-sg-H4O">
|
||||
<popoverArrowDirection key="popoverArrowDirection" up="YES" down="YES" left="YES" right="YES"/>
|
||||
</segue>
|
||||
</connections>
|
||||
</button>
|
||||
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="fov-Ic-2dL">
|
||||
<rect key="frame" x="29" y="264" width="268" height="51"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="32"/>
|
||||
<state key="normal" title="Written Instructions">
|
||||
<color key="titleColor" cocoaTouchSystemColor="scrollViewTexturedBackgroundColor"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="writtenInstructionsBtnPressed:" destination="Obs-kC-EBO" eventType="touchUpInside" id="sKr-xE-dr8"/>
|
||||
<segue destination="EcN-9C-GZO" kind="popoverPresentation" popoverAnchorView="fov-Ic-2dL" id="K7g-fR-33s">
|
||||
<popoverArrowDirection key="popoverArrowDirection" up="YES" down="YES" left="YES" right="YES"/>
|
||||
</segue>
|
||||
</connections>
|
||||
</button>
|
||||
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="DkN-yW-Xgu">
|
||||
<rect key="frame" x="0.0" y="236" width="342" height="2"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" red="0.94275027513504028" green="0.44108907970833666" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="displayP3"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<viewLayoutGuide key="safeArea" id="qYW-KB-ok9"/>
|
||||
@ -662,6 +691,104 @@
|
||||
</objects>
|
||||
<point key="canvasLocation" x="2686.9565217391305" y="776.78571428571422"/>
|
||||
</scene>
|
||||
<!--Written Instructions View Controller-->
|
||||
<scene sceneID="dc9-fV-lT8">
|
||||
<objects>
|
||||
<viewController id="EcN-9C-GZO" customClass="WrittenInstructionsViewController" customModule="Guibe" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="ytx-yX-XHi">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<tableView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="70" estimatedRowHeight="70" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="YPD-fc-WvS">
|
||||
<rect key="frame" x="0.0" y="109" width="414" height="787"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<prototypes>
|
||||
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" selectionStyle="blue" hidesAccessoryWhenEditing="NO" indentationLevel="1" indentationWidth="0.0" reuseIdentifier="iCell" rowHeight="70" id="bUS-jX-rKe">
|
||||
<rect key="frame" x="0.0" y="28" width="414" height="70"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="bUS-jX-rKe" id="Uzf-uP-EpB">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="69.666666666666671"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</tableViewCellContentView>
|
||||
</tableViewCell>
|
||||
</prototypes>
|
||||
<connections>
|
||||
<outlet property="dataSource" destination="EcN-9C-GZO" id="qFb-40-kdb"/>
|
||||
<outlet property="delegate" destination="EcN-9C-GZO" id="oCN-jT-kaS"/>
|
||||
</connections>
|
||||
</tableView>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="serparator" translatesAutoresizingMaskIntoConstraints="NO" id="MhL-up-Fyi">
|
||||
<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="sry-bt-iwt">
|
||||
<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="< Back">
|
||||
<color key="titleColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="backBtnPressed:" destination="EcN-9C-GZO" eventType="touchUpInside" id="OkU-jv-83F"/>
|
||||
<action selector="backBtnPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="VSK-tB-dis"/>
|
||||
<action selector="backBtnPressed:" destination="Obs-kC-EBO" eventType="touchUpInside" id="i0x-QD-V69"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<viewLayoutGuide key="safeArea" id="u6V-N4-N8W"/>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="instructionsTable" destination="YPD-fc-WvS" id="v0N-yg-NsU"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="rG2-rN-jui" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="2686.9565217391305" y="1484.5982142857142"/>
|
||||
</scene>
|
||||
<!--Video Instrictions View Controller-->
|
||||
<scene sceneID="WwL-pG-f9T">
|
||||
<objects>
|
||||
<viewController id="Z1d-IC-mUl" customClass="VideoInstrictionsViewController" customModule="Guibe" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" contentMode="scaleToFill" id="5kX-Rk-2ip">
|
||||
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Video Instructions" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="A1I-wt-9qM">
|
||||
<rect key="frame" x="72" y="160" width="270" height="42"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
||||
<fontDescription key="fontDescription" type="system" pointSize="35"/>
|
||||
<nil key="textColor"/>
|
||||
<nil key="highlightedColor"/>
|
||||
</label>
|
||||
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="serparator" translatesAutoresizingMaskIntoConstraints="NO" id="Jsy-ZZ-va0">
|
||||
<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="yyl-HX-94u">
|
||||
<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="< Back">
|
||||
<color key="titleColor" white="0.66666666669999997" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
</state>
|
||||
<connections>
|
||||
<action selector="backBtnPressed:" destination="EcN-9C-GZO" eventType="touchUpInside" id="X5P-ZB-FCQ"/>
|
||||
<action selector="backBtnPressed:" destination="Obs-kC-EBO" eventType="touchUpInside" id="Z0E-Ue-8JT"/>
|
||||
<action selector="backBtnPressed:" destination="Z1d-IC-mUl" eventType="touchUpInside" id="anV-qE-zRa"/>
|
||||
<action selector="backBtnPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="fmb-qB-nU9"/>
|
||||
</connections>
|
||||
</button>
|
||||
</subviews>
|
||||
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
|
||||
<viewLayoutGuide key="safeArea" id="P0U-bD-d7i"/>
|
||||
</view>
|
||||
</viewController>
|
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="CaX-XU-gd4" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="3603" y="1485"/>
|
||||
</scene>
|
||||
<!--Tech Specs View Controller-->
|
||||
<scene sceneID="VE5-Dr-0hF">
|
||||
<objects>
|
||||
@ -726,7 +853,6 @@
|
||||
<image name="speechBtn" width="331.33334350585938" height="369"/>
|
||||
<image name="startBtn" width="173.33332824707031" height="47.666667938232422"/>
|
||||
<image name="startScreen" width="306" height="661.33331298828125"/>
|
||||
<image name="tempFrame" width="399.33334350585938" height="868"/>
|
||||
<image name="welcome2Screen" width="293.33334350585938" height="636"/>
|
||||
</resources>
|
||||
</document>
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MapKit
|
||||
|
||||
class InstructionsViewController: UIViewController {
|
||||
|
||||
@ -14,9 +15,37 @@ class InstructionsViewController: UIViewController {
|
||||
self.dismiss(animated: true, completion: nil)
|
||||
}
|
||||
|
||||
@IBAction func writtenInstructionsBtnPressed(_ sender: Any) {
|
||||
// let mvc = MainViewController()
|
||||
// let ivc = WrittenInstructionsViewController()
|
||||
//
|
||||
// ivc.stepBySteps = mvc.textSteps
|
||||
// ivc.currentStep = mvc.stepCounter
|
||||
}
|
||||
|
||||
@IBAction func VABtnPressed(_ sender: Any) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ivc.stepBySteps = mvc.textSteps
|
||||
|
||||
// var stepsText: [MKRoute.Step]?
|
||||
// var currentStep: Int = 0
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// let mvc = MainViewController()
|
||||
// let ivc = WrittenInstructionsViewController()
|
||||
//
|
||||
// print("-----InVC-----")
|
||||
// print(stepsText)
|
||||
// print(currentStep)
|
||||
//
|
||||
// ivc.stepBySteps = mvc.textSteps
|
||||
// ivc.currentStep = mvc.stepCounter
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
|
||||
@ -38,6 +38,8 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol {
|
||||
|
||||
var startedNavigation: Bool = false
|
||||
|
||||
var textSteps: [MKRoute.Step]?
|
||||
|
||||
|
||||
// OUTLETS--------------OUTLETS
|
||||
@IBOutlet weak var menuWindowView: UIView!
|
||||
@ -201,20 +203,12 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol {
|
||||
|
||||
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
|
||||
for i in 0 ..< primaryRoute.steps.count {
|
||||
let step = primaryRoute.steps[i]
|
||||
print(step.instructions)
|
||||
print(step.distance)
|
||||
// print(step.instructions)
|
||||
// print(step.distance)
|
||||
// -----------------------------Geofencing setup
|
||||
let region = CLCircularRegion(center: step.polyline.coordinate,
|
||||
radius: 15,
|
||||
@ -226,11 +220,23 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate, myProtocol {
|
||||
}
|
||||
|
||||
let travelTime = Int(primaryRoute.expectedTravelTime/60)
|
||||
// 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.textSteps = primaryRoute.steps
|
||||
|
||||
self.appDelegate.textSteps = self.textSteps
|
||||
self.appDelegate.currentStep = self.stepCounter
|
||||
|
||||
// let ivc = self.storyboard?.instantiateViewController(withIdentifier: "ivc") as! InstructionsViewController
|
||||
// let wivc = WrittenInstructionsViewController()
|
||||
// wivc.stepBySteps = self.textSteps
|
||||
// wivc.currentStep = self.stepCounter
|
||||
|
||||
// ivc.stepsText = self.textSteps
|
||||
// ivc.currentStep = self.stepCounter
|
||||
|
||||
|
||||
self.etaLabel.text = "\(ETAVarLbl)"
|
||||
self.persEtaLbl.text = "\(ETAVarLbl)"
|
||||
|
||||
@ -69,7 +69,7 @@ extension TableViewController: UITableViewDataSource, UITableViewDelegate {
|
||||
|
||||
extension TableViewController: tableViewProtocol {
|
||||
func onClickCell(index: Int) {
|
||||
debugPrint("Going to navigate to option \(index)")
|
||||
// debugPrint("Going to navigate to option \(index)")
|
||||
self.myProtocol?.startNavigation(toPlace: (searchResults?[index])!)
|
||||
self.dismiss(animated: true, completion: nil)
|
||||
}
|
||||
|
||||
35
Guibe/VideoInstrictionsViewController.swift
Normal file
35
Guibe/VideoInstrictionsViewController.swift
Normal file
@ -0,0 +1,35 @@
|
||||
//
|
||||
// VideoInstrictionsViewController.swift
|
||||
// Guibe
|
||||
//
|
||||
// Created by Max Hunt on 02/06/2019.
|
||||
// Copyright © 2019 8. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
|
||||
class VideoInstrictionsViewController: 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.
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
57
Guibe/WrittenInstructionsViewController.swift
Normal file
57
Guibe/WrittenInstructionsViewController.swift
Normal file
@ -0,0 +1,57 @@
|
||||
//
|
||||
// WrittenInstructionsViewController.swift
|
||||
// Guibe
|
||||
//
|
||||
// Created by Max Hunt on 02/06/2019.
|
||||
// Copyright © 2019 8. All rights reserved.
|
||||
//
|
||||
|
||||
import UIKit
|
||||
import MapKit
|
||||
|
||||
class WrittenInstructionsViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
|
||||
|
||||
let appDelegate = UIApplication.shared.delegate as! AppDelegate
|
||||
|
||||
// var stepBySteps = appDelegate.currentStep
|
||||
// var currentStep: Int = 0
|
||||
|
||||
|
||||
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
|
||||
let stepBySteps = appDelegate.textSteps
|
||||
return stepBySteps?.count ?? 0
|
||||
}
|
||||
|
||||
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
|
||||
let cell = tableView.dequeueReusableCell(withIdentifier: "iCell", for: indexPath)
|
||||
let currentStep = appDelegate.currentStep
|
||||
let stepBySteps = appDelegate.textSteps
|
||||
let focusInstruction = (stepBySteps?[indexPath.row].instructions)!
|
||||
if focusInstruction == "" {
|
||||
cell.textLabel?.text = "Start" }
|
||||
else {
|
||||
cell.textLabel?.text = focusInstruction }
|
||||
if indexPath.row == currentStep {
|
||||
cell.backgroundColor = .green }
|
||||
else {
|
||||
cell.backgroundColor = .white }
|
||||
return cell
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@IBAction func backBtnPressed(_ sender: Any) {
|
||||
self.dismiss(animated: true, completion: nil)
|
||||
}
|
||||
|
||||
@IBOutlet weak var instructionsTable: UITableView!
|
||||
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user