Let’s say if we have any UIViewController to be used on any SwiftUI based app we have to follow below steps
Extend the protocol
Implement makeUIViewController and updateUIViewController
However writing a wrapper provides easier way to use it inline for any of the viewControllers.
Here two closures one each for the requirement of UIViewControllerRepresentable.
@autoclsore which will enable us to keep the conventions of
UIViewControllerRepresentable and create our views lazily without requiring any additional syntax during calling.
When accessing a ViewController there might be some cases where accessing
Context might be required , so let’s added some convenience initializers with just
ViewController and without
Here’s the usage of it, let’s say u have