Programmatically embedding a SwiftUI view

  • conditionally adding a chart built with Swift Charts in iOS 16
  • providing an alternative view in older iOS versions
  • embedding the chart within an existing UIKit controller
  • adjusting the size and position of the chart
  • updating the chart from the UIKit layer
You need to purchase the book to read this chapter.Learn more about the bookAlready have a copy? Request access.