Fix regression that prevented Safari from opening from Activity dialog.

This commit is contained in:
Maurice Parker 2020-01-15 18:23:09 -07:00
parent bd29a030e5
commit 4eedd96507
1 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,11 @@ class OpenInSafariActivity: UIActivity {
}
override func perform() {
guard let url = activityItems?.first as? URL else { return }
guard let url = activityItems?.firstElementPassingTest({ $0 is URL }) as? URL else {
activityDidFinish(false)
return
}
UIApplication.shared.open(url, options: [:], completionHandler: nil)
activityDidFinish(true)
}