Skip to content

Instantly share code, notes, and snippets.

@isoiphone
Last active August 29, 2015 14:15
Show Gist options
  • Save isoiphone/a1c8ec2e8fceae3be56b to your computer and use it in GitHub Desktop.
Save isoiphone/a1c8ec2e8fceae3be56b to your computer and use it in GitHub Desktop.
Swift 1.2 breaks my __FUNCTION__
// no longer compiles in swift 1.2
func someFunc(block: () -> (), functionName: String = __FUNCTION__) {
println("NEAT!")
block()
}
someFunc {
println("oh")
}
/*
playground215.swift:7:10: error: missing argument for parameter #1 in call
someFunc {
^
*/
// UPDATE: ok this really never made sense. New behavior is better.
// now default functionName is first param, and closure is second. Works much better.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment