How to remove more than one item at once from Array with matching condition in Swift


In Swift most sequence collections provides removeAll(where:) - an efficient way to remove at once multiple items matching the coditional logic from collection.


Removes all the elements that satisfy the given predicate.

myArray.removeAll { customObject in
    return == "query"    

You might also like: How to limit the number of characters in a UITextField or UITextView

More Articles

Recommended posts