diff --git a/Guibe/Base.lproj/Main.storyboard b/Guibe/Base.lproj/Main.storyboard index f187b6b..e0d9362 100644 --- a/Guibe/Base.lproj/Main.storyboard +++ b/Guibe/Base.lproj/Main.storyboard @@ -351,62 +351,80 @@ - - + + + - - + + + - + + - + + - - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Guibe/MainViewController.swift b/Guibe/MainViewController.swift index b544b4d..1c749e0 100644 --- a/Guibe/MainViewController.swift +++ b/Guibe/MainViewController.swift @@ -54,14 +54,10 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate { dismissBtn.isHidden = false } @IBAction func micBtnPressed(_ sender: Any) { - defaults.set(0, forKey: "setupDone") } @IBAction func dismissBtnPressed(_ sender: Any) { UIView.animate(withDuration: 0.2, animations: {self.menuWindowView.alpha = 0.0}) dismissBtn.isHidden = true - } - @IBAction func settingsBtnPressed(_ sender: Any) { - } // ACTIONS--------------ACTIONS @@ -89,7 +85,7 @@ class MainViewController: UIViewController, AVAudioPlayerDelegate { locationManager.startUpdatingLocation() - } //END VIEW DID LOAD + } //END OF VIEW DID LOAD func getDirections(to destination: MKMapItem) { let sourcePlacemark = MKPlacemark(coordinate: currentCoordinate) diff --git a/Guibe/ViewController.swift b/Guibe/ViewController.swift index 88b2a02..2b30d8d 100644 --- a/Guibe/ViewController.swift +++ b/Guibe/ViewController.swift @@ -26,7 +26,7 @@ class ViewController: UIViewController { } if setupDone == 2 { - DispatchQueue.main.asyncAfter(deadline: .now() + 2) { + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "mainScreen") as! MainViewController nextViewController.modalTransitionStyle = .crossDissolve self.present(nextViewController, animated: true, completion: nil) diff --git a/Guibe/settingsViewController.swift b/Guibe/settingsViewController.swift index 45004af..e6e7651 100644 --- a/Guibe/settingsViewController.swift +++ b/Guibe/settingsViewController.swift @@ -9,13 +9,77 @@ import UIKit 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) { 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() { 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. }