How do you assign an error code to an NSError in Swift? The following gives a compilation error saying "cannot assign to 'code' in 'e'":

```
        var e = NSError()
        e.code = 6;

```

Also why does the following code generate an error of 'Int is not convertible to selector'

```
        if e.code == EKAuthorizationStatus.Restricted
        {
        }

```