|
|
@ -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 { |
|
|
|