diff --git a/Guibe.xcodeproj/project.pbxproj b/Guibe.xcodeproj/project.pbxproj index b6fa0ee..d5bc210 100644 --- a/Guibe.xcodeproj/project.pbxproj +++ b/Guibe.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 50A7ADFD229D766800D58743 /* 7_ReadyViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50A7ADFC229D766800D58743 /* 7_ReadyViewController.swift */; }; 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 */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -39,6 +40,7 @@ 50A7ADFE229D768900D58743 /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = ""; }; 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 = ""; }; + 50A9B4E0229E115B00070F61 /* Video.mov */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = Video.mov; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -74,6 +76,7 @@ isa = PBXGroup; children = ( 50A7AE05229D7B1E00D58743 /* Guibe.entitlements */, + 50A9B4E0229E115B00070F61 /* Video.mov */, 50A7ADD4229D6A4200D58743 /* AppDelegate.swift */, 50A7ADD6229D6A4200D58743 /* ViewController.swift */, 50A7ADE6229D6C7100D58743 /* Assets.xcassets */, @@ -171,6 +174,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 50A9B4E1229E115B00070F61 /* Video.mov in Resources */, 50A7ADDF229D6A4200D58743 /* LaunchScreen.storyboard in Resources */, 50A7ADE7229D6C7100D58743 /* Assets.xcassets in Resources */, 50A7ADDA229D6A4200D58743 /* Main.storyboard in Resources */, diff --git a/Guibe/2_WelcomeViewController.swift b/Guibe/2_WelcomeViewController.swift index ba4b3b7..531fd4b 100644 --- a/Guibe/2_WelcomeViewController.swift +++ b/Guibe/2_WelcomeViewController.swift @@ -15,12 +15,12 @@ class W2lcomeViewController: UIViewController, CLLocationManagerDelegate { override func viewDidLoad() { super.viewDidLoad() - sleep(1) +// sleep(1) self.locationManager.requestAlwaysAuthorization() let xstatus = CLLocationManager.authorizationStatus() if xstatus == CLAuthorizationStatus.authorizedAlways || xstatus == CLAuthorizationStatus.authorizedWhenInUse{ - DispatchQueue.main.asyncAfter(deadline: .now() + 1) { + DispatchQueue.main.asyncAfter(deadline: .now() + 2) { let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen3") as! S3artViewController nextViewController.modalTransitionStyle = .crossDissolve self.present(nextViewController, animated: true, completion: nil) diff --git a/Guibe/3_StartViewController.swift b/Guibe/3_StartViewController.swift index 5ef3d69..0c91cbb 100644 --- a/Guibe/3_StartViewController.swift +++ b/Guibe/3_StartViewController.swift @@ -10,6 +10,11 @@ import UIKit class S3artViewController: UIViewController { + @IBAction func startBtnPressed(_ sender: Any) { + let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen4") as! V4deoViewController + nextViewController.modalTransitionStyle = .crossDissolve + self.present(nextViewController, animated: true, completion: nil) + } override func viewDidLoad() { super.viewDidLoad() diff --git a/Guibe/4_VideoViewController.swift b/Guibe/4_VideoViewController.swift index a733201..6fe11a7 100644 --- a/Guibe/4_VideoViewController.swift +++ b/Guibe/4_VideoViewController.swift @@ -7,15 +7,44 @@ // import UIKit +import AVKit +import AVFoundation class V4deoViewController: UIViewController { - + @IBOutlet var videoBtn: UIButton! + @IBOutlet var nextBtn: UIButton! + override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view. } + @IBAction func nextBtnPressed(_ sender: Any) { + let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen5") as! H5ndChoiceViewController + nextViewController.modalTransitionStyle = .crossDissolve + self.present(nextViewController, animated: true, completion: nil) + } + @IBAction func videoBtnPress(_ sender: Any) { + DispatchQueue.main.asyncAfter(deadline: .now() + 1) { + self.videoBtn.isHidden = true + self.nextBtn.isHidden = false} + playVideo() + } + + private func playVideo() { + guard let path = Bundle.main.path(forResource: "Video", ofType:"mov") else { + debugPrint("Video.mov not found") + return + } + let player = AVPlayer(url: URL(fileURLWithPath: path)) + let playerController = AVPlayerViewController() + playerController.player = player +// playerController.modalPresentationStyle = .popover + present(playerController, animated: true) { + player.play() + } + } /* // MARK: - Navigation diff --git a/Guibe/5_HandChoiceViewController.swift b/Guibe/5_HandChoiceViewController.swift index 5322ec2..2a24284 100644 --- a/Guibe/5_HandChoiceViewController.swift +++ b/Guibe/5_HandChoiceViewController.swift @@ -9,7 +9,22 @@ import UIKit class H5ndChoiceViewController: UIViewController { - + + let defaults = UserDefaults.standard + + @IBAction func lftHandPressed(_ sender: Any) { + defaults.set(1, forKey: "handSide") + let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen6") as! S6deChoiceViewController + nextViewController.modalTransitionStyle = .crossDissolve + self.present(nextViewController, animated: true, completion: nil) + } + @IBAction func ritHandPressed(_ sender: Any) { + defaults.set(2, forKey: "handSide") + let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen6") as! S6deChoiceViewController + nextViewController.modalTransitionStyle = .crossDissolve + self.present(nextViewController, animated: true, completion: nil) + } + override func viewDidLoad() { super.viewDidLoad() diff --git a/Guibe/6_SideChoiceViewController.swift b/Guibe/6_SideChoiceViewController.swift index 78c745f..457fe5f 100644 --- a/Guibe/6_SideChoiceViewController.swift +++ b/Guibe/6_SideChoiceViewController.swift @@ -10,6 +10,21 @@ import UIKit class S6deChoiceViewController: UIViewController { + let defaults = UserDefaults.standard + + @IBAction func topBigPressed(_ sender: Any) { + defaults.set(1, forKey: "bigSide") + let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen7") as! R7adyViewController + nextViewController.modalTransitionStyle = .crossDissolve + self.present(nextViewController, animated: true, completion: nil) + } + @IBAction func bottomBigPressed(_ sender: Any) { + defaults.set(2, forKey: "bigSide") + let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen7") as! R7adyViewController + nextViewController.modalTransitionStyle = .crossDissolve + self.present(nextViewController, animated: true, completion: nil) + } + override func viewDidLoad() { super.viewDidLoad() diff --git a/Guibe/7_ReadyViewController.swift b/Guibe/7_ReadyViewController.swift index e9973d7..5387554 100644 --- a/Guibe/7_ReadyViewController.swift +++ b/Guibe/7_ReadyViewController.swift @@ -12,7 +12,13 @@ class R7adyViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() - + + DispatchQueue.main.asyncAfter(deadline: .now() + 2) { + let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "mainScreen") as! MainViewController + nextViewController.modalTransitionStyle = .crossDissolve + self.present(nextViewController, animated: true, completion: nil) + } + // Do any additional setup after loading the view. } diff --git a/Guibe/Base.lproj/Main.storyboard b/Guibe/Base.lproj/Main.storyboard index 86fcc3f..b7023bf 100644 --- a/Guibe/Base.lproj/Main.storyboard +++ b/Guibe/Base.lproj/Main.storyboard @@ -68,6 +68,9 @@ + + + @@ -86,17 +89,33 @@ - + + + + @@ -119,12 +138,18 @@ + + + @@ -152,12 +177,18 @@ + + + @@ -192,7 +223,7 @@ - + diff --git a/Guibe/Video.mov b/Guibe/Video.mov new file mode 100644 index 0000000..190108b Binary files /dev/null and b/Guibe/Video.mov differ diff --git a/Guibe/ViewController.swift b/Guibe/ViewController.swift index 880052f..64131b5 100644 --- a/Guibe/ViewController.swift +++ b/Guibe/ViewController.swift @@ -17,7 +17,6 @@ class ViewController: UIViewController { let setupDone = defaults.integer(forKey: "setupDone") - if setupDone != 2 { DispatchQueue.main.asyncAfter(deadline: .now() + 2) { let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen2") as! W2lcomeViewController