Skip to content

Instantly share code, notes, and snippets.

@lizixroy
Created September 10, 2016 22:03
Show Gist options
  • Select an option

  • Save lizixroy/d67e90829193686b2bb9cd9d0b78403b to your computer and use it in GitHub Desktop.

Select an option

Save lizixroy/d67e90829193686b2bb9cd9d0b78403b to your computer and use it in GitHub Desktop.
example for an article
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