I am unable to use a framework that uses SwiftUI, built with the Xcode 16 release candidate, in Xcode 15.4. Attempting to build an app that uses the pre-built framework results in "Cannot find type 'SwiftUICore' in scope
errors in the framework's private swift interface (.private.swiftinterface
) file. For example
error: cannot find type 'SwiftUICore' in scope
@_Concurrency.MainActor @preconcurrency public var body: some SwiftUICore.View {
^~~~~~~~~~~
The problem is reproducible by creating a new framework project in Xcode 16, adding SwiftUI code to it, adjusting the deployment target, building the framework, then creating a new app project in Xcode 15.4, adding the framework to it, and attempting to build. In my test framework, I added the following type:
public struct BoldText: View {
let string: String
public init(_ string: String) {
self.string = string
}
public var body: some View {
Text(string).bold()
}
}
When I removed that type, a build of the framework with Xcode 16 became useable in Xcode 15.4.
Is this expected or is this a bug?