title: Swift: array of objects search
body: <p>I want to search in array of objects in swift
  but I didn't know how :(</p>
  
  <p>I tried </p>
  
  <pre><code>filteredArrayUsingPredicate
  </code></pre>
  
  <p>but still don't work ,It's giving me an error msg </p>
  
  <p>-- Update -- </p>
  
  <p>the error message is </p>
  
  <pre><code>swift:42:9: 'Array&lt;search_options&gt;' does not have a member named 'filteredArrayUsingPredicate'
  </code></pre>
  
  <p>-- Update -- </p>
  
  <pre><code>class search_options {
          let id:String
          let option:String
  
          init(){}
  
          init(id:String ,option:String){
              self.id = id
              self.option = option
          }
      }
  </code></pre>
  
  <p>I only want to search in option variable</p>
  
  <p>And when I tried to used  </p>
  
  <pre><code>func searchBarSearchButtonClicked( searchBar: UISearchBar!)
  {
      let filteredArray = filter(search_options_array) { $0 == "test" }
      println(searchBar.text)
  }
  </code></pre>
  
  <p>I got this message </p>
  
  <pre><code>swift:40:58: 'search_options' is not a subtype of 'String'
  </code></pre>