diff --git a/.DS_Store b/.DS_Store index 2401de3..ccb3775 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Playground.swift b/Playground.swift index 289fc33..cdcc138 100644 --- a/Playground.swift +++ b/Playground.swift @@ -4,14 +4,19 @@ import Playgrounds struct Bike { var name: String var color: String - + // newValue ist ein special keyword + var description: String { + set { name = newValue } + get {"A bike called \(name) and it is \(color)." }} static let trek = Bike(name: "Trek", color: "red" ) } #Playground { var greeting = "Hallo Playground" - let bike = Bike.trek - bike.color + var bike = Bike.trek + bike.description + bike.description = "Mein Rad" + bike.description // write code here } diff --git a/TheSwiftWeek.xcodeproj/project.xcworkspace/xcuserdata/rohing73.xcuserdatad/UserInterfaceState.xcuserstate b/TheSwiftWeek.xcodeproj/project.xcworkspace/xcuserdata/rohing73.xcuserdatad/UserInterfaceState.xcuserstate index 2331023..b7e03f7 100644 Binary files a/TheSwiftWeek.xcodeproj/project.xcworkspace/xcuserdata/rohing73.xcuserdatad/UserInterfaceState.xcuserstate and b/TheSwiftWeek.xcodeproj/project.xcworkspace/xcuserdata/rohing73.xcuserdatad/UserInterfaceState.xcuserstate differ