What Should I Use?

The question of when to use a struct or a class is a difficult one. The answer involves understanding the differences between value types and reference types. We discuss the nuances of each in Chapter 18 and provide guidance on when to use both properly.

Get Swift Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.