0

I'm trying to implement searchTextfield to my project, I am using ReactiveKit/Bond. I create a function but don't know how to filter my array elements and create a new array based on searchTextfield.text text.

var myArray = MutableObservableArray(["Monkey", "Tiger", "Lion", "horse"])

searchTextField.reactive.text
    .ignoreNils()
    .throttle(for: 1.0)
    .observeNext(with: { (searchTextField) in
        let filtredArray = names.filter {$0.contains(searchTextField.text)} \\ Here is my mistake, don't know how to fix $0.contain
            
    })

Thank you for any help!

chwarr
  • 6,777
  • 1
  • 30
  • 57
Artem
  • 1
  • Could you include which error you got? What have you tried to fix the issue? – vrwim Oct 20 '20 at 08:17
  • when I type let filtredArray = names.filter {$0. and trying to choose contain operator it says Value of type 'OrderedCollectionChangeset<[String]>' has no member 'contains' – Artem Oct 20 '20 at 13:27

0 Answers0