Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The talk "Demystifying SwiftUI" provides a great deal of insight into how SwiftUI performs diffs.

Basically, unless an identity is explicitly specified using `.id()`, it uses the static types of your views to determine their identity. Naturally, this has a huge effect on what is re-drawn, but also animations.

This is also why AnyView can lead to worse performance - it erases the static type information.

[1]: https://developer.apple.com/videos/play/wwdc2021/10022/



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: