title: Write to a file binary in Xcode
body: <p>I want to create a struct or object and then save it in a file,but I'm confused for do it.
  Do you show the steps?</p>
  
  <p>I have tried to use the writeToFile method, but it isn't a good solution for me because I want to write a structured file,where there are various fields(name,surname,bool field ...).</p>
  
  <p>I don't want to use a database</p>