Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown class in Interface Builder file #74

Closed
barbasevich opened this issue Jun 10, 2020 · 4 comments · Fixed by #75
Closed

Unknown class in Interface Builder file #74

barbasevich opened this issue Jun 10, 2020 · 4 comments · Fixed by #75

Comments

@barbasevich
Copy link
Contributor

I have a simple project TestXIB with CustomView.swift and CustomView.xib.
xib file has customClass="CustomView" customModule="TestXIB" customModuleProvider="target" settings.

When I'm running unit tests and trying to instantiate CustomView from xib I get an error:
Unknown class _TtC39TestXIBTests.__internal__.__test_bundle10CustomView in Interface Builder file.

If I either switch from apple_framework to swift_library or remove customModuleProvider="target" from xib all works fine.

Any ideas on how to solve the issue using apple_framework without xib modification.?

@segiddins
Copy link
Collaborator

I think you want to remove the custom module provider since you’re specifying the module name manually in the xib

@segiddins
Copy link
Collaborator

You’re also using rules_apples unit test and application rules, I’d reccomend trying with the rules in this repo

@barbasevich
Copy link
Contributor Author

@segiddins Thank you, I've tried out to switch to rules_ios's ios_unit_tests and ios_application - no success.

This customModuleProvider is a default setting by Xcode. When you link view to swift class in the same target Xcode automatically propagate customModule="TestXIB" customModuleProvider="target"
xib-custom-class

After looking into apple_library implementation, perhaps it makes sense to pass resources data to swift_library when there are swift sources.? What do you think.?

@segiddins
Copy link
Collaborator

Ah yeah that could be it, good hunch

barbasevich added a commit to barbasevich/rules_ios that referenced this issue Jun 11, 2020
Pass resources to swift_library when there are swift sources.
Otherwise, pass to objc_library.
[bazel-ios#74] Fixes Unknown class in Interface Builder file issue.
@segiddins segiddins linked a pull request Jun 17, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants