diff --git a/.DS_Store b/.DS_Store index 6d51db5..cf7782f 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Assets.xcassets/AppIcon.appiconset/Contents.json b/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..3e2f74f --- /dev/null +++ b/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,36 @@ +{ + "images" : [ + { + "filename" : "swift.png", + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Assets.xcassets/AppIcon.appiconset/swift.png b/Assets.xcassets/AppIcon.appiconset/swift.png new file mode 100644 index 0000000..649674f Binary files /dev/null and b/Assets.xcassets/AppIcon.appiconset/swift.png differ diff --git a/Assets.xcassets/Contents.json b/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/Playground.swift b/Playground.swift index e11b5f7..050d640 100644 --- a/Playground.swift +++ b/Playground.swift @@ -31,6 +31,9 @@ struct Train: Vehicle { return train } + let makeSomeNoise = { (noise: String) -> String in + noise.uppercased() + } } struct ICE: Vehicle { @@ -47,8 +50,19 @@ struct Bike: Vehicle, CustomStringConvertible { } var description: String { set { name = newValue } - get {"A bike called \(name) and it is \(color)." }} + get {"A \(price)€ bike called \(name) and it is \(color)." }} static let trek = Bike(name: "Trek", color: "red" ) + + var price: some Equatable { + // switch (Int.random(in: 1...3)) { + // case 1: + // Double.random(in: 1000...9000) + // case 2: + // "Free" + // default: + Int.random(in: 100...900) + // } + } } #Playground { @@ -63,5 +77,6 @@ struct Bike: Vehicle, CustomStringConvertible { train.delayed(minutes: 23) BikeGarage().park(vehicle: bike) print( bike) + train.makeSomeNoise("huhu") // write code here } diff --git a/TheSwiftWeek.xcodeproj/project.pbxproj b/TheSwiftWeek.xcodeproj/project.pbxproj index 325f7ad..2286949 100644 --- a/TheSwiftWeek.xcodeproj/project.pbxproj +++ b/TheSwiftWeek.xcodeproj/project.pbxproj @@ -10,6 +10,7 @@ 0CC14A872E92EC7B00271E8D /* App.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CC14A842E92EC7A00271E8D /* App.swift */; }; 0CC14A892E92EEA900271E8D /* Playground.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CC14A882E92EEA900271E8D /* Playground.swift */; }; FBA6FA5E2EA63EA300C373EC /* Models.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBA6FA5D2EA63EA300C373EC /* Models.swift */; }; + FBA6FA602EA66C2E00C373EC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FBA6FA5F2EA66C2E00C373EC /* Assets.xcassets */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -17,6 +18,7 @@ 0CC14A842E92EC7A00271E8D /* App.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = App.swift; sourceTree = ""; }; 0CC14A882E92EEA900271E8D /* Playground.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Playground.swift; sourceTree = ""; }; FBA6FA5D2EA63EA300C373EC /* Models.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Models.swift; sourceTree = ""; }; + FBA6FA5F2EA66C2E00C373EC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -34,6 +36,7 @@ isa = PBXGroup; children = ( 0CC14A842E92EC7A00271E8D /* App.swift */, + FBA6FA5F2EA66C2E00C373EC /* Assets.xcassets */, 0CC14A882E92EEA900271E8D /* Playground.swift */, FBA6FA5D2EA63EA300C373EC /* Models.swift */, 0CC14A772E92EC4700271E8D /* Products */, @@ -110,6 +113,7 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + FBA6FA602EA66C2E00C373EC /* Assets.xcassets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/TheSwiftWeek.xcodeproj/project.xcworkspace/xcuserdata/rohing73.xcuserdatad/UserInterfaceState.xcuserstate b/TheSwiftWeek.xcodeproj/project.xcworkspace/xcuserdata/rohing73.xcuserdatad/UserInterfaceState.xcuserstate index 43f4aa0..ee4ad4a 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 diff --git a/TheSwiftWeek.xcodeproj/xcuserdata/rohing73.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/TheSwiftWeek.xcodeproj/xcuserdata/rohing73.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 19e0a0e..e6f8743 100644 --- a/TheSwiftWeek.xcodeproj/xcuserdata/rohing73.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/TheSwiftWeek.xcodeproj/xcuserdata/rohing73.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -14,11 +14,59 @@ filePath = "Playground.swift" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "36" - endingLineNumber = "36" + startingLineNumber = "39" + endingLineNumber = "39" landmarkName = "ICE" landmarkType = "14"> + + + + + + + + + + + + diff --git a/swift.png b/swift.png new file mode 100644 index 0000000..649674f Binary files /dev/null and b/swift.png differ