Skip to content

Instantly share code, notes, and snippets.

@bright23
Created November 12, 2016 04:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bright23/027909b5c79e58b85e2af2d1eee2c7b0 to your computer and use it in GitHub Desktop.
Save bright23/027909b5c79e58b85e2af2d1eee2c7b0 to your computer and use it in GitHub Desktop.
swiftのerrorってこれで出せるんやぁ。 catch のとこで補完出してほしい... #swift #CodePiece
```
do {
try jsonData.write(toFile: url.path, atomically: true, encoding: String.Encoding.utf8)
} catch let error as NSError {
print("error:::\(error)")
fatalError()
}
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment