Skip to content

Commit

Permalink
compass rotation, hide manual slider
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-rutherford committed Aug 24, 2015
1 parent 7037f9c commit 75565c4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Pointing/GameViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Alamofire

class GameViewController: UIViewController, CLLocationManagerDelegate {

@IBOutlet weak var mySlider: UISlider!
@IBOutlet var lblCurrentHeading : UILabel!
@IBOutlet var btnSubmit : UIButton!
// @IBOutlet var lblAcquiringLocation : UILabel!
Expand All @@ -30,6 +31,8 @@ class GameViewController: UIViewController, CLLocationManagerDelegate {
navigationItem.hidesBackButton = true
initLocationManager()
acquireLocationToCompare()
mySlider.hidden = true

}

override func viewDidAppear(animated: Bool) {
Expand Down Expand Up @@ -112,7 +115,11 @@ class GameViewController: UIViewController, CLLocationManagerDelegate {
}

func locationManager(manager: CLLocationManager!, didUpdateHeading newHeading: CLHeading!) {
print("New heading: \(newHeading.trueHeading)")
// print("New heading: \(newHeading.trueHeading)")
var myIntValue:CGFloat = CGFloat(newHeading.trueHeading)
let angle = CGFloat(newHeading.trueHeading) * CGFloat(M_PI) / CGFloat(360)
print("Rotate to: \(myIntValue)")
imgArrow.transform = CGAffineTransformMakeRotation(angle)
}

func locationManager(manager: CLLocationManager!, didChangeAuthorizationStatus status: CLAuthorizationStatus) {
Expand Down

0 comments on commit 75565c4

Please sign in to comment.