Created
June 5, 2020 09:55
-
-
Save Bellaposa/312056d88be8cf61cdaebe68d4667fbe to your computer and use it in GitHub Desktop.
ArrayExtension
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension Array { | |
/// filter(operation: NSPredicate) | |
/// - Parameter operation: NSPredicate | |
/// - Returns: array filtered according to operation NSPredicate | |
public func filter(operation: NSPredicate) -> [Element]? { | |
let array = NSArray(array: self) | |
return array.filtered(using: operation) as? [Element] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment