Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created October 15, 2018 03:29
Show Gist options
  • Save vialyx/44938d470e5519b53193d82e006a45c0 to your computer and use it in GitHub Desktop.
Save vialyx/44938d470e5519b53193d82e006a45c0 to your computer and use it in GitHub Desktop.
struct CreditCard {
var number: String
var date: String
var name: String
var ccv: String
}
extension CreditCard {
init(number: String, date: String, ccv: String) {
self.number = number
self.date = date
self.name = ""
self.ccv = ccv
}
}
let card = CreditCard(number: "4111 1111 1111 1111", date: "09/12", ccv: "183")
print("\(card)")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment