MΓ³dulo 02 Β· Swift, One Level Deeper β LecciΓ³n 2 de 5 Β· ~17 min
Structs: Your Own Types
Making your own types
Int, String, Double β those are Swift's built-ins. But PawWalk thinks in walkers, pets, and bookings. A struct lets you define a type of your own: a named bundle of values.
Each let name: String line inside a struct is a stored property β a piece of data that every value of the type carries. You read one with a dot: walker.name.
You've already met the most important struct in the app. Here it is for real: