diff --git a/.DS_Store b/.DS_Store index ccb3775..02e540c 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Playground.swift b/Playground.swift index cdcc138..ced05e3 100644 --- a/Playground.swift +++ b/Playground.swift @@ -1,7 +1,23 @@ // https://carrascomolina.com import Playgrounds -struct Bike { +protocol Vehicle { + // name ist read-only + var name: String {get} + var color: String {get set} +} + +struct Train: Vehicle { + var name: String + var color = "white" +} + +struct ICE: Vehicle { + var name = "ICE" + var color = "white" +} + +struct Bike: Vehicle { var name: String var color: String // newValue ist ein special keyword @@ -14,9 +30,10 @@ struct Bike { #Playground { var greeting = "Hallo Playground" var bike = Bike.trek + var train = Train(name:"TGV") bike.description bike.description = "Mein Rad" bike.description - + train // 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 b7e03f7..02f8009 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