Schulung_iOS/Playground.swift
2025-10-20 13:48:12 +02:00

22 lines
511 B
Swift

// https://carrascomolina.com
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"
var bike = Bike.trek
bike.description
bike.description = "Mein Rad"
bike.description
// write code here
}