some changes

This commit is contained in:
Max Hunt 2019-05-30 11:52:19 +01:00
parent 5b39f8bcb6
commit 17e84bf157
4 changed files with 101 additions and 23 deletions

View File

@ -351,62 +351,80 @@
<action selector="backBtnPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="vz8-xF-uSj"/> <action selector="backBtnPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="vz8-xF-uSj"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleAspectFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yUo-9A-eP3"> <button opaque="NO" contentMode="scaleAspectFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="yUo-9A-eP3" userLabel="leftBtn">
<rect key="frame" x="27" y="278" width="173" height="178"/> <rect key="frame" x="27" y="278" width="175" height="178"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="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"/>
<state key="normal" backgroundImage="s1l"/> <state key="normal" backgroundImage="s1l"/>
<connections> <connections>
<action selector="leftBtnPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="8S8-ne-cal"/>
<action selector="lftHandPressed:" destination="1fA-dZ-9ei" eventType="touchUpInside" id="iWC-za-Mhl"/> <action selector="lftHandPressed:" destination="1fA-dZ-9ei" eventType="touchUpInside" id="iWC-za-Mhl"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleAspectFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wdb-kA-JMS"> <button opaque="NO" contentMode="scaleAspectFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="wdb-kA-JMS" userLabel="rightBtn">
<rect key="frame" x="219" y="278" width="179" height="178"/> <rect key="frame" x="215" y="278" width="183" height="178"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="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"/>
<state key="normal" backgroundImage="s1r"/> <state key="normal" backgroundImage="s1r"/>
<connections> <connections>
<action selector="rightBtnPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="fKN-wJ-853"/>
<action selector="ritHandPressed:" destination="1fA-dZ-9ei" eventType="touchUpInside" id="Pri-mu-NZc"/> <action selector="ritHandPressed:" destination="1fA-dZ-9ei" eventType="touchUpInside" id="Pri-mu-NZc"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleAspectFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="THO-p7-oiF"> <button opaque="NO" contentMode="scaleAspectFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="THO-p7-oiF" userLabel="bTopBtn">
<rect key="frame" x="20" y="689" width="182" height="180"/> <rect key="frame" x="20" y="689" width="182" height="180"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="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"/>
<state key="normal" backgroundImage="s2t"/> <state key="normal" backgroundImage="s2t"/>
<connections> <connections>
<action selector="bTopBtnPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="Sp8-Ef-FWw"/>
<action selector="topBigPressed:" destination="Y31-kj-JwL" eventType="touchUpInside" id="hcV-CC-Ktt"/> <action selector="topBigPressed:" destination="Y31-kj-JwL" eventType="touchUpInside" id="hcV-CC-Ktt"/>
</connections> </connections>
</button> </button>
<button opaque="NO" contentMode="scaleAspectFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nvb-Td-arP"> <button opaque="NO" contentMode="scaleAspectFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="Nvb-Td-arP" userLabel="sTopBtn">
<rect key="frame" x="215" y="689" width="183" height="180"/> <rect key="frame" x="215" y="689" width="183" height="180"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="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"/>
<state key="normal" backgroundImage="s2b"/> <state key="normal" backgroundImage="s2b"/>
<connections> <connections>
<action selector="bottomBigPressed:" destination="Y31-kj-JwL" eventType="touchUpInside" id="N70-Ou-Cc5"/> <action selector="bottomBigPressed:" destination="Y31-kj-JwL" eventType="touchUpInside" id="N70-Ou-Cc5"/>
<action selector="sTopBtnPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="sAq-Pz-QbB"/>
</connections> </connections>
</button> </button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="circle" translatesAutoresizingMaskIntoConstraints="NO" id="fn6-xO-kaN"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="circle" translatesAutoresizingMaskIntoConstraints="NO" id="WDv-sY-oOi">
<rect key="frame" x="210" y="689" width="193" height="180"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="circle" translatesAutoresizingMaskIntoConstraints="NO" id="0ZX-JT-JpQ">
<rect key="frame" x="15" y="689" width="193" height="180"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="circle" translatesAutoresizingMaskIntoConstraints="NO" id="WDv-sY-oOi">
<rect key="frame" x="14" y="273" width="193" height="180"/> <rect key="frame" x="14" y="273" width="193" height="180"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView> </imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="circle" translatesAutoresizingMaskIntoConstraints="NO" id="ZDz-GQ-0Cc"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="circle" translatesAutoresizingMaskIntoConstraints="NO" id="ZDz-GQ-0Cc">
<rect key="frame" x="211" y="273" width="193" height="180"/> <rect key="frame" x="211" y="273" width="193" height="180"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView> </imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="circle" translatesAutoresizingMaskIntoConstraints="NO" id="0ZX-JT-JpQ">
<rect key="frame" x="15" y="689" width="193" height="180"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" alpha="0.0" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="circle" translatesAutoresizingMaskIntoConstraints="NO" id="fn6-xO-kaN">
<rect key="frame" x="210" y="689" width="193" height="180"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
</imageView>
<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"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Reset Config"/>
<connections>
<action selector="resetCfgPressed:" destination="C7R-cA-IIg" eventType="touchUpInside" id="yTQ-3x-JnU"/>
</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="iMX-Fb-tJF"/> <viewLayoutGuide key="safeArea" id="iMX-Fb-tJF"/>
</view> </view>
<connections>
<outlet property="CSTop" destination="fn6-xO-kaN" id="lVs-zO-Wtb"/>
<outlet property="cBTop" destination="0ZX-JT-JpQ" id="Tyb-6u-Zls"/>
<outlet property="cLeft" destination="WDv-sY-oOi" id="zwL-Wg-cRa"/>
<outlet property="cRight" destination="ZDz-GQ-0Cc" id="ULK-qC-VTO"/>
</connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="C73-06-ntv" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="C73-06-ntv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>

View File

@ -54,14 +54,10 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate {
dismissBtn.isHidden = false dismissBtn.isHidden = false
} }
@IBAction func micBtnPressed(_ sender: Any) { @IBAction func micBtnPressed(_ sender: Any) {
defaults.set(0, forKey: "setupDone")
} }
@IBAction func dismissBtnPressed(_ sender: Any) { @IBAction func dismissBtnPressed(_ sender: Any) {
UIView.animate(withDuration: 0.2, animations: {self.menuWindowView.alpha = 0.0}) UIView.animate(withDuration: 0.2, animations: {self.menuWindowView.alpha = 0.0})
dismissBtn.isHidden = true dismissBtn.isHidden = true
}
@IBAction func settingsBtnPressed(_ sender: Any) {
} }
// ACTIONS--------------ACTIONS // ACTIONS--------------ACTIONS
@ -89,7 +85,7 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate {
locationManager.startUpdatingLocation() locationManager.startUpdatingLocation()
} //END VIEW DID LOAD } //END OF VIEW DID LOAD
func getDirections(to destination: MKMapItem) { func getDirections(to destination: MKMapItem) {
let sourcePlacemark = MKPlacemark(coordinate: currentCoordinate) let sourcePlacemark = MKPlacemark(coordinate: currentCoordinate)

View File

@ -26,7 +26,7 @@ class ViewController: UIViewController {
} }
if setupDone == 2 { if setupDone == 2 {
DispatchQueue.main.asyncAfter(deadline: .now() + 2) { DispatchQueue.main.asyncAfter(deadline: .now() + 1) {
let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "mainScreen") as! MainViewController let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "mainScreen") as! MainViewController
nextViewController.modalTransitionStyle = .crossDissolve nextViewController.modalTransitionStyle = .crossDissolve
self.present(nextViewController, animated: true, completion: nil) self.present(nextViewController, animated: true, completion: nil)

View File

@ -9,13 +9,77 @@
import UIKit import UIKit
class settingsViewController: UIViewController { class settingsViewController: UIViewController {
let defaults = UserDefaults.standard
// OUTLETS--------------OUTLETS
@IBOutlet weak var cLeft: UIImageView!
@IBOutlet weak var cRight: UIImageView!
@IBOutlet weak var cBTop: UIImageView!
@IBOutlet weak var CSTop: UIImageView!
// OUTLETS--------------OUTLETS
// ACTIONS--------------ACTIONS
@IBAction func backBtnPressed(_ sender: Any) { @IBAction func backBtnPressed(_ sender: Any) {
self.dismiss(animated: true, completion: nil) self.dismiss(animated: true, completion: nil)
} }
@IBAction func leftBtnPressed(_ sender: Any) {
if defaults.integer(forKey: "handSide") == 2{
defaults.set(1, forKey: "handSide")
UIView.animate(withDuration: 0.4, animations: {self.cLeft.alpha = 1.0})
UIView.animate(withDuration: 0.4, animations: {self.cRight.alpha = 0.0})
}
}
@IBAction func rightBtnPressed(_ sender: Any) {
if defaults.integer(forKey: "handSide") == 1{
defaults.set(2, forKey: "handSide")
UIView.animate(withDuration: 0.4, animations: {self.cLeft.alpha = 0.0})
UIView.animate(withDuration: 0.4, animations: {self.cRight.alpha = 1.0})
}
}
@IBAction func bTopBtnPressed(_ sender: Any) {
if defaults.integer(forKey: "bigSide") == 2{
defaults.set(1, forKey: "bigSide")
UIView.animate(withDuration: 0.4, animations: {self.cBTop.alpha = 1.0})
UIView.animate(withDuration: 0.4, animations: {self.CSTop.alpha = 0.0})
}
}
@IBAction func sTopBtnPressed(_ sender: Any) {
if defaults.integer(forKey: "bigSide") == 1{
defaults.set(2, forKey: "bigSide")
UIView.animate(withDuration: 0.4, animations: {self.cBTop.alpha = 0.0})
UIView.animate(withDuration: 0.4, animations: {self.CSTop.alpha = 1.0})
}
}
@IBAction func resetCfgPressed(_ sender: Any) {
defaults.set(0, forKey: "setupDone")
}
// ACTIONS--------------ACTIONS
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
switch defaults.integer(forKey: "handSide") {
case 1:
cLeft.alpha = 1.0
cRight.alpha = 0.0
case 2:
cLeft.alpha = 0.0
cRight.alpha = 1.0
default:
print("ERROR, THIS CANNOT HAPPEN!!!!!")
}
switch defaults.integer(forKey: "bigSide") {
case 1:
cBTop.alpha = 1.0
CSTop.alpha = 0.0
case 2:
cBTop.alpha = 0.0
CSTop.alpha = 1.0
default:
print("ERROR, THIS CANNOT HAPPEN!!!!!")
}
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }