Q:

Why do we use &error in Swift?

I commonly see a pointer to an optional error variable being used, just like in this block of code:
if fileManager.fileExistsAtPath(path)
{
    var error: NSError?

    if !fileManager.removeItemAtPath(path, error: &error)
    {
        println("Error removing the file : \(error)")
    }
}

Why do we do this?

A:

The error parameter is an inout parameter, and can set the value of error rather than returning it from the function. Look up "inout" in Apple's iBook on Swift. 

