In Swift, how can you use NSPredicate to search in a custom class that contains both a string and a NSNumber?
<p>Currently I have a search bar that searches JSON data by name:</p>

<pre><code>  func updateSearchResultsForSearchController(searchController: UISearchController) {

    self.filteredSearchResults.removeAll(keepCapacity: false)
    let searchPredicate = NSPredicate(format: " SELF CONTAINS [c] %@", searchController.searchBar.text!)
    let array = (self.channelArray as NSArray).filteredArrayUsingPredicate(searchPredicate)
    self.filteredSearchResults = array as! [ChannelInfo]
    self.tableView.reloadData()
  }
</code></pre>

<p>The filtered search results should return a custom class that contains the name searched for:</p>

<pre><code>class ChannelInfo {

  var logo: String
  var channelName: String
  var id: NSNumber 

  init(logo: String, channelName: String , id: NSNumber) {

    self.logo = logo
    self.channelName = channelName
    self.id = id
  }
}
</code></pre>

<p>currently I'm getting an error whenever I use the search bar:</p>

<pre><code>Can't use in/contains operator with collection .ChannelInfo (not a collection)'
</code></pre>

<p>I'm assuming it's because the custom class contains both a string and NSNumber. Any info to fix this problem is greatly appreciated!</p>