2 ms·
It can draw stuff directly rather than going through UIKit. Example via WWDC by Sundell: https://wwdcbysundell.com/2019/swiftui-relationship-to-uikit-appkit/ ht
by wlesieutre 6y ago
It can draw stuff directly rather than going through UIKit. Example via WWDC by Sundell: https://wwdcbysundell.com/2019/swiftui-relationship-to-uikit-appkit/ https://wwdcbysundell.com/2019/swiftui-relationship-to-uikit...
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.