Skip to content

Instantly share code, notes, and snippets.

@BradB132
Created May 31, 2015 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BradB132/8045d86bdbd1c0ada4c5 to your computer and use it in GitHub Desktop.
Save BradB132/8045d86bdbd1c0ada4c5 to your computer and use it in GitHub Desktop.
FirstAppInSwift-7
func defaultParameters(myArg:Int = 0) {
// ...
}
defaultParameters() //passing nothing gives 'myArg' a value of 0
defaultParameters(myArg: 5) //'myArg' will be 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment