title: How do i use array.filter to filter a class object based on a property?
body: <p>I'm trying to filter an array of instances of a class. I'd like a new array filtered by one of the class properties. Can't quite get my head around the way Swift filters work for this use case.</p>
  
  <pre><code>enum Gender {
      case male,female
  }
  
  class Person {
      let name:String
      let gender:Gender
      init(name:String,gender:Gender) {
          self.name = name
          self.gender = gender
      }
  }
  
  
  let people = [Person.init(name: "James", gender: .male),
                Person.init(name: "John", gender: .male),
                Person.init(name: "Sally", gender: .female)
               ]
  
  let males = people.filter( something )
  </code></pre>