Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct Test {
- var first: Double
- var second: Double {
- get {
- return first * 2
- }
- set {
- first = newValue / 2
- }
- }
- }
- var test = Test(first: 30)
- test.second
- test.second = 90
- test.first
Advertisement
Add Comment
Please, Sign In to add comment