Why could a distribution build be failed with SwiftUI?
I added SwiftUI into my iOS 10+ project, and build it locally with @available(iOS 13.0, *)
prefix, but when I try to build the project for distribution, the build is failed with the following error:
cannot find type 'UIHostingController' in scope
The same error appears for other SwifUI types in my project (Text
, View
, Font
, etc).
The UIHostingController
type is provided by SwiftUI, not UIKit, so most likely, you need to add import SwiftUI
to the top of your view controller source file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With