Skip to content

Instantly share code, notes, and snippets.

@isoiphone
Created September 30, 2015 23:35
Show Gist options
  • Select an option

  • Save isoiphone/ed21c54ad2c81d6fd9d4 to your computer and use it in GitHub Desktop.

Select an option

Save isoiphone/ed21c54ad2c81d6fd9d4 to your computer and use it in GitHub Desktop.
Default parameter handling changed
import UIKit
/*
// In Swift 1.2 this definition gave us what we wanted
func lerp(a: Float, b: Float, t: Float) -> Float {
return (b-a)*t+a
}
*/
// now Swift 2.0 requires this
func lerp(a: Float, _ b: Float, _ t: Float) -> Float {
return (b-a)*t+a
}
// so that this works
lerp(1, 2, 0.5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment