title: How do I create a Set of custom objects (Swift)?
body: <p>For my iOS app I have a model something like</p>
  
  <pre><code>class Person {
      var Id: Int
      var Name: String
  
      init(id: Int, name: String?) {
          self.Id = id
          self.Name = name ?? ""
      }
  }
  </code></pre>
  
  <p>Then later on in my <code>ViewController</code> when I load data from the server I add some people to an array</p>
  
  <pre><code>class ViewController: UIViewController {
      var people:[Person] = []
  
      override func viewDidLoad() {
          self.loadPeople()
      }
  
      func loadPeople() {
          // This data will be coming from a server request
          // so is just sample. It could have users which 
          // already exist in the people array
  
          self.people.append(Person(id: "1", name: "Josh"))
          self.people.append(Person(id: "2", name: "Ben"))
          self.people.append(Person(id: "3", name: "Adam"))
      }
  }
  </code></pre>
  
  <p>What I am now trying todo is turn the <code>people</code> array into a <code>Set&lt;Person&gt;</code> so it will not add duplicates. Is this possible to do or do I need to change my logic?</p>