title: Swift - Delete value from model in realm
body: <p>I'm trying to delete an object from my <code>realm</code> with <code>swift3</code>. When the user logs in with google, the userinfos are stored in realm db. Now I want to delete the user, when I click a button. </p>
  
  <p>Here is my unfinished code:</p>
  
  <pre><code>@IBAction func deleteUser(_ sender: Any) {
  
      let realm = try! Realm()
      let userObject = realm.objects(userInfos.self).filter("id == 0").first
      realm.delete(userObject)
      try! realm.write
  
      print("deleted")
      print(userObject)
  }
  </code></pre>
  
  <p>The code above is not working. What is wrong?</p>
  
  <p>Thanks for your help !</p>