From 0fd0789a59b17ecf8f642ffd819754c9c972a7bd Mon Sep 17 00:00:00 2001 From: David Keegan Date: Mon, 18 Jul 2016 23:22:46 -0700 Subject: [PATCH] update for Xcode 8 v2 --- NSDate+Extension.swift | 6 +++--- Tests/NSDateTimeAgoTests.swift | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/NSDate+Extension.swift b/NSDate+Extension.swift index 3f7349d..1daa230 100644 --- a/NSDate+Extension.swift +++ b/NSDate+Extension.swift @@ -17,7 +17,7 @@ func NSDateTimeAgoLocalizedStrings(_ key: String) -> String { resourcePath = frameworkBundle.resourcePath } else { // Load from Main Bundle - resourcePath = Bundle.main().resourcePath + resourcePath = Bundle.main.resourcePath } if resourcePath == nil { @@ -138,7 +138,7 @@ extension Date { } private func dateComponents() -> DateComponents { - let calander = Calendar.current() + let calander = Calendar.current return calander.components([.second, .minute, .hour, .day, .month, .year], from: self, to: Date(), options: []) } @@ -148,7 +148,7 @@ extension Date { } private func getLocaleFormatUnderscores(withValue value: Double) -> String { - guard let localeCode = Locale.preferredLanguages().first else { + guard let localeCode = Locale.preferredLanguages.first else { return "" } diff --git a/Tests/NSDateTimeAgoTests.swift b/Tests/NSDateTimeAgoTests.swift index 948477d..778a0ad 100644 --- a/Tests/NSDateTimeAgoTests.swift +++ b/Tests/NSDateTimeAgoTests.swift @@ -22,7 +22,7 @@ class NSDateTimeAgoTests: XCTestCase { } func dateForComponents(block: (inout components: DateComponents) -> Void) -> Date? { - let calander = Calendar.current() + let calander = Calendar.current var components = DateComponents() block(components: &components) return calander.date(byAdding: components, to: Date(), options: [])