Browse Source

Fix TODO.

pull/101/head
Abhishek 4 years ago
parent
commit
f728e6144f
  1. 10
      Clocker/Events and Reminders/CalendarHandler.swift

10
Clocker/Events and Reminders/CalendarHandler.swift

@ -392,8 +392,14 @@ extension EventCenter {
private func retrieveMeetingURL(_ event: EKEvent) -> URL? { private func retrieveMeetingURL(_ event: EKEvent) -> URL? {
if EventCenter.dataDetector == nil { if EventCenter.dataDetector == nil {
// TODO: Handle Try-Catch gracefully var dataDetector: NSDataDetector? = nil
EventCenter.dataDetector = try! NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue) do {
dataDetector = try NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue)
} catch {
assertionFailure("Unable to create a link-type data detector")
return nil
}
EventCenter.dataDetector = dataDetector
} }
if let location = event.location { if let location = event.location {

Loading…
Cancel
Save