ContentsOfFile method deprecated in swift 2.2
<p>My code in Objective-C is</p>

<pre><code>NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:@"Logger.txt"];
NSString *content = [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:NULL];
</code></pre>

<p>When I try to convert this to swift, I am not able to convert it as the method <code>ContentsOfFile</code> has been deprecated. Can anyone tell me how to convert that to swift? I am working with Xcode 7.2 and swift 2.2. My code in swift is </p>

<pre><code>var paths : NSArray = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
    var documentsDirectory : NSString = paths[0] as! String
    var filePath = documentsDirectory.stringByAppendingPathComponent("Logger.txt")
    var error:NSError?
    let content = NSString(contentsOfFile: filePath, encoding:NSUTF8StringEncoding, error: &amp;error)
    if let theError = error {
        NSLog("\(theError.localizedDescription)")
    }
</code></pre>