IBDesignable and multiple targets in Swift
Asked Answered
F

1

8

Seems like IBDesignable has some problems with multiple targets and swift modules. After I've added new target (my app has 2 targets now, e.g. seller and buyer), my StoryBoard began to halt views building with warning:

Storyboard: warning: IB Designables: Using class UITextField for object with  
custom class because the class _TtC15******Buyer11HCTextField does not exist

I think, designables compiler fails to find proper *swift** module somehow.
Any suggestions how to fix this?

Pic:

enter image description here

I'm using Xcode 7.0.1 and Swift2

Farleigh answered 9/10, 2015 at 8:28 Comment(4)
I'm also noticing this issue, although there is one thing you should check. Double check that your IBDesignable files are added to both the 'buyer' and 'seller' targets.Karelia
@MikeCole, no luck! The solution: move custom views to separate framework.Farleigh
I was afraid of that. We have that approach working, but it seems like such overhead.Karelia
@MikeCole, kind of. Forces to link lots of frameworks and pods with this Designables framework. But the build time decreased dramatically.Farleigh
F
1

The final solution is... Create a framework! It solves all the problem. Just keep your designables in separate bundle.

Farleigh answered 25/5, 2016 at 19:55 Comment(1)
Having the same issue, I also have multiple targets and currently trying to use a custom UIView from github. I drag the file to my project so that I can customize. I guess I should use CocoapodsHileman

© 2022 - 2024 — McMap. All rights reserved.