Created
September 10, 2016 21:54
-
-
Save lizixroy/36ae6d2886932a00db5207b43efa2e43 to your computer and use it in GitHub Desktop.
example for an article
This file contains hidden or 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
func uw<T>(variable: T?, file: StaticString = #file, line: UInt = #line) -> T { | |
continueAfterFailure = false | |
guard let variable = variable else { | |
XCTFail("unexpectedly found nil while unwrapping an Optional value", file: file, line: line) | |
precondition(false) | |
} | |
return variable | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment