Custom views from external framework not working in Interface Builder
Asked Answered
S

0

8

I was looking for some solution to this on this site and I found this answer which don't solve my problem.

How to use custom UIView from external framework (file with extension .framework) in Interface Builder without using CocoaPods and without adding this project as target of my project.

Let's say I have a separate project created with: Cocoa Touch Framework Project Template and I would like to use it in my other project. I added it to Embedded Binaries and Linked Frameworks and Libraries, I can use in Objective-C:

@import MyFramework;

and in Swift:

import MyFramework

But from unknown reason Interface Builder don't see custom views with @IBDesignable The funny think is when my project is running the custom views from external framework are displaying properly. The only problem is that during design process in Interface Builder don't display anything.

I'm not using CocoaPods and I don't want to embed my framework project as a Target because this is common framework for many projects. How can I attach this external project/framework to my project so that Interface Builder will be working fine with it. When I create target with Cocoa Touch Framework project template so that this framework is "inside" my project then Interface Builder is working as expected during design time and during runtime.

Is there any way I can attach my external project as a target to other project?

Seasickness answered 7/7, 2016 at 11:10 Comment(4)
when storyboard selected please check for automatically refresh views selected in Editor menu.Fewer
Hi @MarcinKapusta, I'm having the same issue. Did you manage to fix this problem?Driving
Did you manage to find a solution? @ThomasNeuteboomPatch
@Patch For what I know for now, it is not possible. You need to add the framework project as 'sub-project'. It needs to build it dynamically every time you open a storyboard it is used in.Driving

© 2022 - 2024 — McMap. All rights reserved.