filtered(using:)
Evaluates a given predicate against each object in the receiving array and returns a new array containing the objects for which the predicate returns true.
Declaration
func filtered(using predicate: NSPredicate) -> [Any]Parameters
- predicate:
The predicate against which to evaluate the receiving array’s elements.
Return Value
A new array containing the objects in the receiving array for which predicate returns true.
Objects in the resulting array appear in the same order as they do in the receiver.
Discussion
For more details, see Predicate Programming Guide.