Skip to content

Instantly share code, notes, and snippets.

@robertmryan
Last active February 28, 2016 23:17
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 robertmryan/658b00944427e8601aff to your computer and use it in GitHub Desktop.
Save robertmryan/658b00944427e8601aff to your computer and use it in GitHub Desktop.
// original class
class A {
var x: String
init(x: String) {
self.x = x
}
}
// new class
class A {
var x: String
var y: String
init(x: String, y: String = "bar") {
self.x = x
self.y = y
}
}
// that way, this still works:
let a = A(x: "foo")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment