Re:How Swift 5.3 enhances SwiftUI’s DSL
by spideymans on Sunday September 13, 2020 @03:48PM
(#24463416)
It's not too early to "commit" to SwiftUI. Just remember that "committing" doesn't mean writing every last bit of UI code in SwiftUI. At this stage, I think the best approach is to be using both UIKit and SwiftUI, and use whichever framework is better for implementing whatever specific features you're implementing.
For example, say I'm presenting a modal with a simple form. I'd use UIKit's UINavigationContoller to present the modal view, and within the modal's view, I'd have a UIHostingController which encapsulates the SwiftUI-defined form user interface. I can define form layouts (and other simple layouts) much quicker in SwiftUI than I can in UIKit, so I'm finding SwiftUI to be very helpful in that regard.
Re:How Swift 5.3 enhances SwiftUI’s DSL
by saagarjha on Sunday September 13, 2020 @04:46PM
(#24463832)
You must commit to not use SwiftUI if you support an older OS. If your deployment target is last year or newer, then do you have the ability to pick and choose.
For example, say I'm presenting a modal with a simple form. I'd use UIKit's UINavigationContoller to present the modal view, and within the modal's view, I'd have a UIHostingController which encapsulates the SwiftUI-defined form user interface. I can define form layouts (and other simple layouts) much quicker in SwiftUI than I can in UIKit, so I'm finding SwiftUI to be very helpful in that regard.