-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
IBDesignables and IBInspectables #335
Comments
You happen to have a build log? |
From
Are the logs somewhere else? |
Hmm, maybe running the latest carthage with |
Running version 0.6.0
|
Hmm, seems to build correctly. If you build the framework without Carthage and integrate it, do your custom views show up correctly in Interface Builder? |
Hmmm, building the project and the adding the resulting framework from the derived data folder has the same result (can't be used in Storyboards)... Maybe I am doing something wrong here with these frameworks |
I'm tentatively closing this one then, since it seems to be either a configuration issue or an issue with Xcode. Feel free to reopen this if you have any new insights ✌️ |
Apparently this is a limitation in frameworks? when they are compiled all the IBDesignable and IBInspectable information is lost. Have you guys ever created a reusable .framework file that supports them? |
I had the same issue. It looks a limitation of a built framework. Check the header file (TargetName-Swift.h) in the built framework folder. It has no information for IBDesignable and IBInspectable though IBOutlet can be marked to properties in the header file. For now, the framework project must be added to your product project to enable IBDesignable and IBInspectable, or just use User Defined Runtime Attributes instead. I hope a future update of Xcode solve the issue. |
Still no good on Xcode 7 Beta 6 |
Has anyone else filed an issue with Apple yet? |
I did, it was marked as duplicate a loooong time ago |
The issue was reported 16 months ago and there is still no ideal solution. I have a workaround for this problem and I posted it onto stackoverflow: http://stackoverflow.com/questions/29933691/ibdesignable-from-external-framework/37631860#37631860 The basic idea is to create a sub class for the view in the destination app: @IBDesignable
class MyCustomView: CustomView {
@IBInspectable override var bgColor: NSColor {
get {
return super.bgColor
}
set {
super.bgColor = newValue
}
}
} Please read here for more details: http://stackoverflow.com/questions/29933691/ibdesignable-from-external-framework/37631860#37631860 If you like it please vote up. 👍 |
I found a way to have designables work with Cocoa Touch frameworks. You can supply a source file where designable attributes are provided on categories, and which clients can then use when compiling their project. For full details, please read http://stackoverflow.com/a/39999914/760435 |
Xcode 8 and Swift 3, 1 year later, still no solution ??? |
Still no solution to this issue ? |
Bump. Any word? |
This is an Apple/Xcode limitation. It’s not something that Carthage can fix. |
Might not be an issue of Carthage per say. But I have ran into problems using IB Designables and IB Inspectables on frameworks using Carthage. Have you encountered this before?
Two examples are MengTo/Spring#11 (comment) and https://github.com/raulriera/TextFieldEffects both are affected by this
The text was updated successfully, but these errors were encountered: