“Interface Builder 文件中的未知类 BarChartView"使用自定义框架时出错 [英] "Unknown class BarChartView in Interface Builder file" error when using a custom framework

查看:53
本文介绍了“Interface Builder 文件中的未知类 BarChartView"使用自定义框架时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的应用中使用 Charts 框架.我已经使用 Carthage 为此构建了二进制文件并添加到我的应用程序中并包含两个文件:

I am trying to use the Charts framework in my app. I have build the binary for this using Carthage and added to my app and contains two files:

 - Charts-Swift.h
 - Charts.h

然后我将视图的自定义类设置为 BarChartView,但 XCode 似乎无法识别该类(无自动完成).而且自定义模块也没有设置.

Then I have set the custom class of a view to BarChartView, but it seems that XCode doesn't recognize the class (No autocomplete). And the custom module is not set also.

当我运行应用程序时,我总是收到此警告:

When I run the app I always get this warning:

Unknown class BarChartView in Interface Builder file

我尝试了一些来自互联网的解决方案,但似乎对我没有任何作用.
任何人都有 Xcode 8.1Swift 3 的解决方案?

I have try some solutions from the internet, but nothing seems to work for me.
Anyone has a solution for Xcode 8.1 and Swift 3 ?

推荐答案

您只需要通过指定模块图表"来通知 IB 类的来源.

You just need inform IB where the class comes from, by specifying the module 'Charts'.

这篇关于“Interface Builder 文件中的未知类 BarChartView"使用自定义框架时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆