Skip to content

Commit e443527

Browse files
oschrenkOliver Schrenk
authored andcommitted
feat: Return proper type description for calendars
1 parent 13a051d commit e443527

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

Sources/Model/Calendar.swift

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,31 @@ extension CGColor {
1919
}
2020
}
2121

22+
extension EKCalendarType: CustomStringConvertible {
23+
public var description: String {
24+
switch self {
25+
case .local:
26+
return "local"
27+
case .calDAV:
28+
return "caldav"
29+
case .exchange:
30+
return "exchange"
31+
case .subscription:
32+
return "subscription"
33+
case .birthday:
34+
return "birthday"
35+
default:
36+
return "unknown"
37+
}
38+
}
39+
}
40+
2241
extension EKCalendar {
2342
func asCal() -> Calendar {
2443
let id = calendarIdentifier
2544
let label = title
2645
let color = cgColor.asHexString()
27-
let type = String(describing: type)
46+
let type = type.description
2847

2948
return Calendar(
3049
id: id,

0 commit comments

Comments
 (0)