Understanding SwiftUI - Why are Views in SwiftUI Struct and not Class?
Feb 26, 2023 · 3 min read · Why SwiftUI prefers Struct over Class? SwiftUI Views are structs instead of classes. This avoids having multiple inherited properties, keeps them lightweight and improves performance. SwiftUI Views are passed by value. This avoids retain cycles and...
Join discussion