I have some SwiftUI code and it seems to work great when I build to a real iOS device or to an iOS simulator.
However in the SwiftUI canvas the preview says Failed to build MySwiftUI.swift
clicking on the diagnostics button next to Try Again
reveals that it failed with the error:
ld: framework not found FrameworkMyAppUses
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have FrameworkMyAppUses
built for simulator and device, and it is in my framework search paths. Building the app to simulator and device both succeed and make use of my framework with no issue, its only the canvas preview that can't build.
If I hit Try again
Xcode will tell me Build Succeeded
but the canvas preview window continues to just display the framework not found error.
Has anyone else experienced this / knows potential fixes?