Created
September 30, 2015 23:35
-
-
Save isoiphone/ed21c54ad2c81d6fd9d4 to your computer and use it in GitHub Desktop.
Default parameter handling changed
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
| 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