Skip to content

Commit 59bacf9

Browse files
damuellenparkera
authored andcommitted
Updated to match Darwin version (#439)
1 parent ac33719 commit 59bacf9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Foundation/NSCalendar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public class Calendar: NSObject, NSCopying, NSSecureCoding {
177177
}
178178

179179

180-
public class func currentCalendar() -> Calendar {
180+
public class var current: Calendar {
181181
return CFCalendarCopyCurrent()._nsObject
182182
}
183183

TestFoundation/TestNSCalendar.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,18 @@ class TestNSCalendar: XCTestCase {
8080
XCTAssertNil(calendar)
8181
}
8282

83-
func test_currentCalendarRRstability() {
83+
func test_currentRRstability() {
8484
var AMSymbols = [String]()
8585
for _ in 1...10 {
86-
let cal = Calendar.currentCalendar()
86+
let cal = Calendar.current
8787
AMSymbols.append(cal.AMSymbol)
8888
}
8989

9090
XCTAssertEqual(AMSymbols.count, 10, "Accessing current calendar should work over multiple callouts")
9191
}
9292

9393
func test_copy() {
94-
let calendar = Calendar.currentCalendar()
94+
let calendar = Calendar.current
9595

9696
//Mutate below fields and check if change is being reflected in copy.
9797
calendar.firstWeekday = 2

0 commit comments

Comments
 (0)