32. Integrating UIViews with SwiftUI
Prior to the introduction of SwiftUI, all iOS apps were developed using UIKit together with a collection of UIKit-based supporting frameworks. Although SwiftUI is provided with a wide selection of components with which to build an app, there are many instances where there is no SwiftUI equivalent to options provided by the other frameworks. There is, for example, no SwiftUI equivalent to the MKMapView or WebView classes provided by the MapKit and WebView frameworks, or the powerful animation features of UIKit Dynamics.
Given the quantity of apps that were developed before the introduction of SwiftUI it is also important to be able to integrate existing non-SwiftUI functionality with SwiftUI development projects and vice versa. Fortunately, SwiftUI includes a number of options to perform this type of integration.
32.1 SwiftUI and UIKit Integration
Before looking in detail at integrating SwiftUI and UIKit it is worth taking some time to explore whether...