Chapter 3 - Efficient data structure

Hi,

Thanks for writing this good book!

I have a question about the efficient data structure mentioned in in page 59 Chapter 3:

SwiftUI encourages you to create small reusable views, then customize them with modifiers for the specific context where you use them. And don’t worry, SwiftUI collapse the modified view into an efficient data structure, so you get all this convenience with no visible performance hit.

What is it, could you elaborate more? Thanks!

hi xiantao, it’s a view tree with some special tricks. objc.io’s book Thinking in SwiftUI dives deeply into how SwiftUI works. A public article expands even more (and references the objc.io book).

1 Like