mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-28 06:47:15 +00:00
Replaced old deprecated selectors with new selectors
This commit is contained in:
1 parent
a4fee11947
commit
4b0a769246
7 files changed
+13
-13
No files matched your search
@@ -19,7 +19,7 @@ class CourseViewController: UIViewController {
|
||||
|
||||
courseLabel.text = defaultCourseText
|
||||
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:"newLocation:", name:LocationManager.NotificationType.newLocation, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(CourseViewController.newLocation(_:)), name:LocationManager.NotificationType.newLocation, object: nil)
|
||||
}
|
||||
|
||||
deinit {
|
||||
|
||||
@@ -26,10 +26,10 @@ public class DataManager: NSObject {
|
||||
print(managedObjectContext!)
|
||||
|
||||
// store new locations to database
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector: "newLocation:", name: LocationManager.NotificationType.newLocation, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(DataManager.newLocation(_:)), name: LocationManager.NotificationType.newLocation, object: nil)
|
||||
|
||||
// save context when done tracking
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector: "trackingStopped:", name: LocationManager.NotificationType.trackingStopped, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(DataManager.trackingStopped(_:)), name: LocationManager.NotificationType.trackingStopped, object: nil)
|
||||
}
|
||||
|
||||
deinit {
|
||||
|
||||
@@ -33,8 +33,8 @@ class GPSAccuracyView : UIView {
|
||||
barView.frame = bounds
|
||||
|
||||
// add listeners
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:"newLocation:", name:LocationManager.NotificationType.newLocation, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:"locationManagerFailed:", name:LocationManager.NotificationType.locationManagerFailed, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(GPSAccuracyView.newLocation(_:)), name:LocationManager.NotificationType.newLocation, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(GPSAccuracyView.locationManagerFailed(_:)), name:LocationManager.NotificationType.locationManagerFailed, object: nil)
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ class HomeViewController: UIViewController, UITableViewDataSource, UITableViewDe
|
||||
}
|
||||
|
||||
// register for open custom URL events
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector: "openUrl:", name: AppDelegate.NotificationType.openUrl, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(HomeViewController.openUrl(_:)), name: AppDelegate.NotificationType.openUrl, object: nil)
|
||||
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector: "checkEULA:", name: UIApplicationWillEnterForegroundNotification, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(HomeViewController.checkEULA(_:)), name: UIApplicationWillEnterForegroundNotification, object: nil)
|
||||
|
||||
checkEULA(NSNotification.init(name: "", object: nil))
|
||||
|
||||
@@ -152,7 +152,7 @@ class HomeViewController: UIViewController, UITableViewDataSource, UITableViewDe
|
||||
}
|
||||
|
||||
func _DEBUG_OPEN_URL() {
|
||||
let url = "http://ec2-54-171-89-140.eu-west-1.compute.amazonaws.com:8888/tracking/checkin?event_id=71c7b531-fb1b-441c-b2fa-f4e9ff672d60&leaderboard_name=Ubigatta&competitor_id=9df7b4f6-611b-4be0-b028-c7b1bdd434c2"
|
||||
//let url = "http://ec2-54-171-89-140.eu-west-1.compute.amazonaws.com:8888/tracking/checkin?event_id=71c7b531-fb1b-441c-b2fa-f4e9ff672d60&leaderboard_name=Ubigatta&competitor_id=9df7b4f6-611b-4be0-b028-c7b1bdd434c2"
|
||||
let url2 = "http://ec2-54-171-89-140.eu-west-1.compute.amazonaws.com:8888/tracking/checkin?event_id=71c7b531-fb1b-441c-b2fa-f4e9ff672d60&leaderboard_name=Ubigatta&competitor_id=a5a00800-daf8-0131-89e6-60a44ce903c3"
|
||||
checkInController!.startCheckIn(url2)
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ class RegattaViewController : UIViewController, UIActionSheetDelegate, UINavigat
|
||||
hoursLabel.text = String(format: "%.0f", arguments: [hours])
|
||||
minutesLabel.text = String(format: "%.0f", arguments: [minutes])
|
||||
loop?.invalidate()
|
||||
loop = NSTimer(timeInterval: 60, target: self, selector: "checkRegattaStatus", userInfo: nil, repeats: false)
|
||||
loop = NSTimer(timeInterval: 60, target: self, selector: #selector(RegattaViewController.checkRegattaStatus), userInfo: nil, repeats: false)
|
||||
NSRunLoop.currentRunLoop().addTimer(loop!, forMode:NSRunLoopCommonModes)
|
||||
}
|
||||
// during race
|
||||
|
||||
@@ -43,7 +43,7 @@ class SendGPSFixController: NSObject {
|
||||
|
||||
/* See if any rows need to be uploaded. Schedule timer again. */
|
||||
func timer() {
|
||||
let loop = NSTimer.scheduledTimerWithTimeInterval(syncPeriod, target:self, selector:"timer", userInfo:nil, repeats:false)
|
||||
let loop = NSTimer.scheduledTimerWithTimeInterval(syncPeriod, target:self, selector:#selector(SendGPSFixController.timer), userInfo:nil, repeats:false)
|
||||
NSRunLoop.currentRunLoop().addTimer(loop, forMode:NSRunLoopCommonModes)
|
||||
|
||||
// get last 100 locations
|
||||
|
||||
@@ -35,9 +35,9 @@ class TrackingViewController : UIViewController {
|
||||
networkAvailabilityChanged()
|
||||
|
||||
// register for notifications
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:"networkAvailabilityChanged", name:APIManager.NotificationType.networkAvailabilityChanged, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:"newLocation:", name:LocationManager.NotificationType.newLocation, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:"locationManagerFailed:", name:LocationManager.NotificationType.locationManagerFailed, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(TrackingViewController.networkAvailabilityChanged), name:APIManager.NotificationType.networkAvailabilityChanged, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(TrackingViewController.newLocation(_:)), name:LocationManager.NotificationType.newLocation, object: nil)
|
||||
NSNotificationCenter.defaultCenter().addObserver(self, selector:#selector(TrackingViewController.locationManagerFailed(_:)), name:LocationManager.NotificationType.locationManagerFailed, object: nil)
|
||||
}
|
||||
|
||||
// MARK:- Buttons
|
||||
|
||||
Reference in new issue
Block a user