Replace the firstElementPassingTest function come from RSCore with the native function first(where:).

This commit is contained in:
zgjie
2020-04-06 02:06:24 +08:00
parent 116a346b87
commit bcfd75ff68
3 changed files with 4 additions and 4 deletions

View File

@@ -37,7 +37,7 @@ class OpenInSafariActivity: UIActivity {
}
override func perform() {
guard let url = activityItems?.firstElementPassingTest({ $0 is URL }) as? URL else {
guard let url = activityItems?.first(where: { $0 is URL }) as? URL else {
activityDidFinish(false)
return
}