SwiftUI is great for creating views for your iPhone application, but sometimes you need UIKit to fill some gaps. UIViewRepresentable provides a way to bridge the gap between UIKit and SwiftUI by wrapping a UIKit view and allowing you to use that view in SwiftUI.
I recently wrote about bringing Writing Tools to SwiftUI, but as mentioned in that tutorial, SwiftUI is limited and only brings a small part of the available features. The only feature available to a TextEditor in regards to writing tools is .writingToolsBehavior.
In this tutorial, we’ll look at how to bring a UIKit view into SwiftUI.
[Read more…]