4 ms·
You’re correct in that SwiftUI is just another library built on top of Swift. SwiftUI heavily takes advantage of a relatively new Swift feature: result builders
by vlozko 5y ago
You’re correct in that SwiftUI is just another library built on top of Swift. SwiftUI heavily takes advantage of a relatively new Swift feature: result builders. So while SwiftUI code is technically Swift code, at times it does feel like a different language as control flow operates differently.
- randomNumber7 5y agoAll the @State, @Published etc. pragmas look to me like they hacked the compiler to do the stuff they couldn't do in a regular library....
- viktorcode 5y agoThose are just property wrappers; another feature of the language accessible to everyone.
- b3morales 5y agoIncorrect. The SwiftUI property wrappers, most notably @State, use internal knowledge and non-public reflection. They are not stably implementable by outsiders.