99 lines
3.3 KiB
Swift
99 lines
3.3 KiB
Swift
//
|
|
// 3_StartViewController.swift
|
|
// Guibe
|
|
//
|
|
// Created by Max Hunt on 28/05/2019.
|
|
// Copyright © 2019 8. All rights reserved.
|
|
//
|
|
|
|
import UIKit
|
|
import CoreLocation
|
|
import AVKit
|
|
|
|
class S3artViewController: UIViewController, CLLocationManagerDelegate {
|
|
|
|
@IBOutlet var getStartedBtn: UIButton!
|
|
@IBOutlet var playAgainBtn: UIButton!
|
|
@IBOutlet var nextBtn: UIButton!
|
|
|
|
|
|
let locationManager = CLLocationManager()
|
|
|
|
@IBAction func startBtnPressed(_ sender: Any) {
|
|
// DispatchQueue.main.asyncAfter(deadline: .now() + 1){
|
|
// self.getStartedBtn.isHidden = true
|
|
// self.playAgainBtn.isHidden = false
|
|
// self.nextBtn.isHidden = false
|
|
// self.nextBtn.layer.shadowColor = UIColor.black.cgColor
|
|
// self.nextBtn.layer.shadowOffset = CGSize(width: 2, height: 5)
|
|
// self.nextBtn.layer.shadowRadius = 5
|
|
// self.nextBtn.layer.shadowOpacity = 0.2
|
|
// }
|
|
// playVideo()
|
|
let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "audioSet") as! AudioInstrViewController
|
|
// let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen5") as! H5ndChoiceViewController
|
|
nextViewController.modalTransitionStyle = .crossDissolve
|
|
self.present(nextViewController, animated: true, completion: nil)
|
|
}
|
|
|
|
|
|
@IBAction func playAgainBtnPressed(_ sender: Any) {
|
|
playVideo()
|
|
}
|
|
@IBAction func nextBtnPressed(_ sender: Any) {
|
|
// let nextViewController = self.storyboard?.instantiateViewController(withIdentifier: "screen5") as! H5ndChoiceViewController
|
|
// nextViewController.modalTransitionStyle = .crossDissolve
|
|
// self.present(nextViewController, animated: true, completion: nil)
|
|
}
|
|
|
|
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
// self.locationManager.delegate = self
|
|
getStartedBtn.accessibilityLabel = "Get started"
|
|
playAgainBtn.accessibilityLabel = "Play again"
|
|
nextBtn.accessibilityLabel = "Next"
|
|
|
|
self.locationManager.requestAlwaysAuthorization()
|
|
|
|
|
|
// Do any additional setup after loading the view.
|
|
}
|
|
|
|
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
|
|
|
|
// 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.
|
|
}
|
|
*/
|
|
|
|
}
|
|
|
|
/*
|
|
class W2lcomeViewController: UIViewController, CLLocationManagerDelegate {
|
|
|
|
let locationManager = CLLocationManager()
|
|
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
// sleep(1)
|
|
self.locationManager.requestAlwaysAuthorization()
|
|
*/
|