Skip to content

Commit 30be519

Browse files
author
Robert F. Dickerson
committed
Migrated NSDate to new API
1 parent e3a860e commit 30be519

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Foundation/NSDate.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ public class NSDate : NSObject, NSCopying, NSSecureCoding, NSCoding {
134134
offset in hours and minutes from UTC (for example,
135135
"2001-03-24 10:45:32 +0600")
136136
*/
137-
public func descriptionWithLocale(_ locale: AnyObject?) -> String {
138-
guard let aLocale = locale else { return description }
137+
public func description(_ with: AnyObject?) -> String {
138+
guard let aLocale = with else { return description }
139139
let dateFormatterRef = CFDateFormatterCreate(kCFAllocatorSystemDefault, (aLocale as! NSLocale)._cfObject, kCFDateFormatterFullStyle, kCFDateFormatterFullStyle)
140140
CFDateFormatterSetProperty(dateFormatterRef, kCFDateFormatterTimeZoneKey, CFTimeZoneCopySystem())
141141

@@ -149,12 +149,12 @@ public class NSDate : NSObject, NSCopying, NSSecureCoding, NSCoding {
149149

150150
extension NSDate {
151151

152-
public func timeIntervalSinceDate(_ anotherDate: NSDate) -> NSTimeInterval {
152+
public func timeIntervalSince(_ anotherDate: NSDate) -> NSTimeInterval {
153153
return self.timeIntervalSinceReferenceDate - anotherDate.timeIntervalSinceReferenceDate
154154
}
155155

156156
public var timeIntervalSinceNow: NSTimeInterval {
157-
return timeIntervalSinceDate(NSDate())
157+
return timeIntervalSince(NSDate())
158158
}
159159

160160
public var timeIntervalSince1970: NSTimeInterval {

0 commit comments

Comments
 (0)