Is SwiftUI just an abstraction over AppKit and UIKit ? Does it bring any widgets of its own - ie something native to SwiftUI as opposed to being wrapped ? (apart from the declarative stuff)
struct ContentView: View {
var body: some View {
VStack {
ForEach(0..<3) { _ in
HStack {
Text("Leading")
Text("Trailing")
}
}
}
}
}
> Looking at the above code sample, it’s easy to jump to the conclusion that the resulting UI will consist of a vertically aligned UIStackView — which’ll then contain a set of horizontally aligned, nested stack views, which in turn each will contain two labels rendered using UILabel. However, none of those assumptions are actually true — as SwiftUI instead draws our labels directly using the private CGDrawingView class.Under the hood it will use some UIKit like UIScrollView but the whole architecture is different.
On UIKit, the objects you create stay retained as long as they are used and all you do is to change properties when using.
On SwiftUI, everything is released and retained every time there’s a change.
That’s why you need to address the life cycle differences when you use UIKit and SwiftUI together.
https://stackoverflow.com/questions/64049757/are-swiftui-com...
It is a completely new paradigm, that’s it. Implementation details are just that.