Created
November 12, 2016 04:31
-
-
Save bright23/027909b5c79e58b85e2af2d1eee2c7b0 to your computer and use it in GitHub Desktop.
swiftのerrorってこれで出せるんやぁ。
catch のとこで補完出してほしい... #swift #CodePiece
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
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