Skip to content

Swift types

Swift Types

Copy on Write (CoW)

Copy on write example. Medium

Medium Example

Good article

Class and Struct

Classes (reference types) are allocated in the heap, value types (like Struct, String, Int, Bool, etc) live in the stack. See this topic for more detailed answers: Why Choose Struct Over Class?

Value and Reference types

Apple docs