Last active
October 17, 2019 04:21
-
-
Save alimir1/bd79d7a212ec819907076e997b9fd056 to your computer and use it in GitHub Desktop.
This file contains 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
enum FruitType: String { | |
case fuji, gala, crispin | |
} | |
struct Fruit { | |
var type: FruitType | |
let expirationDate: Date | |
} | |
var apple = Fruit(type: .fuji, expirationDate: Date()) | |
let appleCopy = apple | |
apple.type = .gala // change apple type | |
print(apple.type) // gala | |
print(appleCopy.type) // fuji |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment