I am trying out Swift in the XCode beta. In particular using an @IBDesignable and @IBInspectable. I am building a framework containing an (@IBDesignable) UIView subclass and a Simple iOS App in order to test it out (Both contained in and linked via a workspace). After a few successful builds I get the following error in the framework build output:
:0: error: /Users/richardpj/Projects/Swift2/Swift2FW/build/Swift2FW.build/Debug-iphonesimulator/Swift2FW.build/unextended-module.modulemap:2: umbrella header 'Swift2FW.h' not found :0: error: could not build Objective-C module 'Swift2FW'
Before you ask I've done a clean and deleted my derived data but nothing seems to resolve it except deleting and recreating the workspace and project files.
Any ideas on the source of the error, how to replicate (for a bug report) OR am I being dumb.
EDIT: I've gotten 50 views since this was posted. Sounds like it's a bug I should report. Any ideas on how to do that?
Error handling is the process of responding to and recovering from error conditions in your app [1]. Once an error occurs, the two things we can do about it is to terminate or recover. Let’s see how we can achieve this with the Swift Combine Framework.
The umbrella header is actually designated for mixed swift, obj-c framework and its purpose is exposing the APIs to the outer world that your framework has in objective-c or c. That means the headers we put there should be in the public scope.
(And that is exactly why Allows Non-modular Includes in Framework Modules defaults to NO) In order to expose Objective-C/C library to your framework swift code, we should define a separate swift module for such library. Then a standard swift import YourLegacyLibrary can be used.
When making my own swift framework I got the error "could not build Objective-C module".
I fixed it by going to "Link Binary With Libraries" and adding "UIKit".
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