IBInspectable within framework runtime error

hi,

I moved a custom control to my Framework lib (Cocoa Touch Ffamework):


import UIKit
@IBDesignable public class MyButton: UIButton {
    public let DefaultBGColor = UIColor(red:40.0/255.0, green:120.0/255.0, blue:210.0/255.0, alpha:0.6)
    @IBInspectable var cornerRadius:CGFloat = 6 {
        didSet{
            self.layer.cornerRadius = cornerRadius
            self.setNeedsDisplay()
        }
    }
}


I included successifully the Library to my App project

Now in the storyboard I tried to use it, but setting the customClass I notice that :

- within the Identity Inspector tab the module field is not filled and designable label is not present. neither the user runtime attribute.

- within the Attribute Inspector tab I don't see my custom property.

- at runtime I have a message: Unknown class MyButton in Interface Builder file that bloc the execution of my app


how can I solve it?

Have I to do something compiling my Framework?

Is the framework a target in your project? IBDesignable/IBInspectable only works with "internal" framework.

i create The framework as a separate project and then import The library dependency in The project and added to embedded section.

should i define something more in the library project?


what do you mean with "works only with internal framework"?

It only works if you add new framework target in your project (project -> targets -> add new cocoa touch framework). It doesn't work if you import external framework like you have done.

i would to create a share Library to use with several projects.

the scenario you are talking about is to include the library project within the main app project, and then create a target for this? as dependency target?

do you have an example or a documentation where I can find something about this specific scenario?

thanks

IBInspectable within framework runtime error
 
 
Q