Integrating SwiftUI in UIKit and Build Settings to Xcode.

Follow below steps

  1. Make SwiftUI View ready

2. Include it in UIKit Code like below.

3. If the project is supporting version ≤= iOS 12.0 , Update the Build Settings of Xcode like below.

Expand Link Binary With Libraries then Click on + and then Add SwiftUI.framework and make it Optional

4. In case, if you have added SwiftUI View as part of Development pod, make sure to update the podspec file with below config.

spec.xcconfig = { ‘OTHER_LDFLAGS’ => ‘-weak_framework “SwiftUI”’ }

Then perform pod install , make to validate the other Linker Flags should like below.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store