title: How can I read a file in a swift playground
body: <p>Im trying to read a text file using a Swift playground with the following</p>
  
  <pre><code>let dirs : String[]? =    NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory.DocumentDirectory, NSSearchPathDomainMask.UserDomainMask, true) as? String[]
  
  if (dirs != nil) {
      let directories:String[] = dirs!;
      let dir = directories[0]; //documents directory
      let path = dir.stringByAppendingPathComponent(file);
  
      //read
      let content = String.stringWithContentsOfFile(path, encoding: NSUTF8StringEncoding, error: nil)
  }
  </code></pre>
  
  <p>However this fails with no error. It seems the first line stops the playground from outputting anything below</p>