title: Read a text file line by line in Swift?
body: <p>I just started learning Swift. I have got my code to read from the text file, and the App displays the content of the entire text file. How can I display line by line and call upon that line multiple times?</p>
  
  <p><code>TextFile.txt</code> contains the following:</p>
  
  <pre><code>1. Banana 
  2. Apple
  3. pear
  4. strawberry
  5. blueberry
  6. blackcurrant
  </code></pre>
  
  <p>The following is what currently have..</p>
  
  <pre><code>  if let path = NSBundle.mainBundle().pathForResource("TextFile", ofType: "txt"){
          var data = String(contentsOfFile:path, encoding: NSUTF8StringEncoding, error: nil)
              if let content = (data){
                  TextView.text = content
      }
  </code></pre>
  
  <p>If there is another way of doing this please let me know. It would be much appreciated.</p>