title: Swift Text File To Array of Strings
body: <p>I was wondering what the simplest and cleanest to read a text file into an array of strings is in swift.</p>
  
  <p>Text file:</p>
  
  <pre><code>line 1
  line 2
  line 3 
  line 4
  </code></pre>
  
  <p>Into an array like this:</p>
  
  <pre><code>var array = ["line 1","line 2","line 3","line 4"]
  </code></pre>
  
  <p>I would also like to know how to do a similar thing into struct like this:</p>
  
  <pre><code>Struct struct{
     var name: String!
     var email: String!
  }
  </code></pre>
  
  <p>so take a text file and put it into struct's in an array.</p>
  
  <p>Thanks for the help!</p>