Updates project so it builds with Swift 2.3

This commit is contained in:
César Pinto Castillo
2016-09-08 13:15:59 +02:00
parent 586ef9e215
commit 96f70c8bdf
5 changed files with 44 additions and 30 deletions

View File

@@ -1023,7 +1023,8 @@ public class Manager : ArmchairManager {
// Increment the key's count
var incrementKeyCount = userDefaultsObject?.integerForKey(incrementKey)
userDefaultsObject?.setInteger(++incrementKeyCount!, forKey:incrementKey)
incrementKeyCount! += 1
userDefaultsObject?.setInteger(incrementKeyCount!, forKey:incrementKey)
debugLog("Incremented \(incrementKeyType): \(incrementKeyCount!)")
@@ -1759,9 +1760,9 @@ public class Manager : ArmchairManager {
private func setupNotifications() {
#if os(iOS)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "appWillResignActive:", name: UIApplicationWillResignActiveNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "applicationDidFinishLaunching:", name: UIApplicationDidFinishLaunchingNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "applicationWillEnterForeground:", name: UIApplicationWillEnterForegroundNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(Manager.appWillResignActive(_:)), name: UIApplicationWillResignActiveNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(UIApplicationDelegate.applicationDidFinishLaunching(_:)), name: UIApplicationDidFinishLaunchingNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: #selector(UIApplicationDelegate.applicationWillEnterForeground(_:)), name: UIApplicationWillEnterForegroundNotification, object: nil)
#elseif os(OSX)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "appWillResignActive:", name: NSApplicationWillResignActiveNotification, object: nil)
NSNotificationCenter.defaultCenter().addObserver(self, selector: "applicationDidFinishLaunching:", name: NSApplicationDidFinishLaunchingNotification, object: nil)
@@ -1790,7 +1791,7 @@ public class Manager : ArmchairManager {
})
}
}
private func debugLog(log: String, file: StaticString = __FILE__, function: StaticString = __FUNCTION__, line: UInt = __LINE__) {
private func debugLog(log: String, file: StaticString = #file, function: StaticString = #function, line: UInt = #line) {
logger(self, log: log, file: file, function: function, line: line)
}