How to distribute designable / inspectable custom views with Carthage

261 views Asked by At

is there a way to distribute a custom IBDesignable / IBInspectable UIView control in a framework with Carthage?

Here is a demo framework:

https://github.com/exchangegroup/MyCustomView

It has a designable MyCustomView with an inspectable property myBorderWidth.

custom_class

The designable view shows in the storyboard of the the framework project.

inspectable_works

But, if I include this framework in another app with Carthage, the storyboard does not allow to design the MyCustomView.

Here is a demo app that uses it with Carthage:

https://github.com/exchangegroup/UsingMyCustomView

inspectable_does_not_work

Is there a way to way to distribute designable UIView with carthage?

Tested in Xcode 6.4 and Xcode 7.

Carthage: 0.6.4

1

There are 1 answers

0
drunknbass On

You can, but you need to include a bundle that is linked in the host app that contains your assets (storyboard). If you want them to be able to drag a uiview into a storyboard, see your custom design and/or edit it that's a little tricky. If your uiview overrides awakeafternib you can actually design it in such a way that you can simply drag them into storyboards and they fully render without needing an additional container view . I'm not aware of a way to edit your original storyboard view as if it were a template.