Created
September 10, 2016 22:03
-
-
Save lizixroy/d67e90829193686b2bb9cd9d0b78403b 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 g<T>(array: [T], at index: Int, file: StaticString = #file, line: UInt = #line) -> T { | |
| continueAfterFailure = false | |
| guard index < array.count else { | |
| XCTFail("index out of range", file: file, line: line) | |
| precondition(false) | |
| } | |
| return array[index] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment