Daily iOS
Memory and ARC

Memory cost of value types

How far is it true that "using a struct means no ARC cost"?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

The struct itself isn't managed by ARC, but if it has reference fields inside, every copy does one retain per field. Collections like String and Array hold a reference to a heap buffer, so they count too.

Share a question