-
-
Save fitomad/e24e691b1dd5d365fcb805450890dea9 to your computer and use it in GitHub Desktop.
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
let result = Result { try String(contentsOfFile: "/path/to/file") } | |
switch result | |
{ | |
case .success(let fileContent): | |
print("File content:\r\n\(fileContent)") | |
case .failure(let reason): | |
print("Error: \(reason.localizedDescription)") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment