Public XCFramework class not recognized in Interface Builder

Hello,

In Interface Builder I used to be able to select a framework's class as a custom class if I set the Module to None and don't Inherit Module from Target. However, that framework has recently been updated to an XCFramework, and this has stopped working. I have narrowed the issue down to this particular reason after multiple debugging steps (identical build settings, SwiftUI, using Swift version 5, -ObjC compiler flags and using Podfile !use_frameworks). The project won't build if I use !static_frameworks, or comment out !use_frameworks, so I can't seem to find a workaround. However, the .swift files in my main target can import the framework and use the custom class, but I cannot select the class in Interface Builder. If I type the class name anyway (without autocomplete), I get a warning "Unknown Class in Interface Builder file".

Why is this, and are there any steps I can take as an end-user of the framework to resolve this issue? I also noticed that the new XCFramework uses iOS 9 as the deployment target (ignoring the iOS 14 version from the Podfile), so the ObjC runtime changes could be the cause? If so, would anyone be able to explain how to workaround this (if possible in the first place!). Even a workaround would be great for now.

I have attached an image to help visualise the issueScreenshot 2021-03-03 at 00.36.29

Thanks for the help! :blush:

1 Like

I have the same problem, did you find any solution for this?