Skip to content

Instantly share code, notes, and snippets.

@vialyx
Created October 15, 2018 03:36
Show Gist options
  • Save vialyx/19a64226de62a86e50ce27360ff7e090 to your computer and use it in GitHub Desktop.
Save vialyx/19a64226de62a86e50ce27360ff7e090 to your computer and use it in GitHub Desktop.
extension CreditCard {
mutating func clear() {
self.number = ""
self.date = ""
self.name = ""
self.ccv = ""
}
}
var expiredCard = CreditCard(number: "4111 0000 0000 0000", date: "03/03", ccv: "003")
expiredCard.clear()
print("expired card info: \(expiredCard.info())")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment