从pod依赖项中使用IB_DESIGNABLE实时渲染自定义组件 [英] Live Rendering a custom component using IB_DESIGNABLE from a pod dependency

查看:251
本文介绍了从pod依赖项中使用IB_DESIGNABLE实时渲染自定义组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在pod中使用 IB_DESIGNABLE 时遇到了一些困难。

I'm having some difficulty using IB_DESIGNABLE in a pod.

我创建了一个自定义视图标记为 IB_DESIGNABLE 并制作了一个使用它的示例项目。到目前为止没有问题。

I created a custom view which I marked as IB_DESIGNABLE and made a sample project that uses it. No problems so far.

将自定义视图添加为pod依赖项时会出现问题。虽然项目已成功构建和运行,但在打开使用自定义视图的故事板时会出现错误。实时渲染过程启动并尝试在界面构建器中显示实时视图,但它失败并显示以下错误:

The issue happens when adding that custom view as a pod dependency. Although the project builds and runs successfully, there is an error when the storyboard that uses the custom view is opened. The Live Rendering process starts and tries to show the view live inside Interface builder but it fails with the following error:

这太糟糕了,因为我们失去了实时渲染,在我看来,这是一个来自Xcode 6的最佳功能。

This is too bad because we lose Live Rendering which is, in my opinion, one of the best features from Xcode 6.


  • Cocoapods宝石版: 0.34.4

  • Xcode版本: 6.1(6A1052d)

  • Cocoapods gem version: 0.34.4
  • Xcode version: 6.1 (6A1052d)

我尝试过其他项目使用 IB_DESIGNABLE 并拥有 podspec

I've tried with other projects that use IB_DESIGNABLE and have a podspec:


  1. https://github.com/Eddpt/EAColourfulProgressView (分类: EAColourfulProgressView

  2. https:// github .com / hayashi311 / HRButton (分类: HRButton

  3. https://github.com/Estimote/iOS-Indoor-SDK (分类: ESTIndoorLocationView

  1. https://github.com/Eddpt/EAColourfulProgressView (Class: EAColourfulProgressView)
  2. https://github.com/hayashi311/HRButton (Class: HRButton)
  3. https://github.com/Estimote/iOS-Indoor-SDK (Class: ESTIndoorLocationView)

其他人在 Estimote - 室内位置错误但描述的解决方案意味着失去实时渲染功能。

Someone else had the same issue in Estimote - Indoor Location Error but the solution described means losing Live Rendering capabilities.

有没有人能通过Cocoapods使用 IB_DESIGNABLE 组件?

Has anyone been able to use a IB_DESIGNABLE component through Cocoapods?

错误:无法从路径加载可设计项(null)

Error: "failed to load designables from path (null)"

推荐答案

这已在最新修复版本的 Cocoapods(0.36.0.beta.1)

This has been fixed in the latest version of Cocoapods (0.36.0.beta.1).

安装此版本:

[sudo] gem install cocoapods - -pre

有关的更多信息带框架的Cocoapods 此处

More information about Cocoapods with frameworks here

为了修复错误:无法从路径加载可设计项(null)

platform :ios, '7.0'

use_frameworks!

target 'test' do
pod 'EAColourfulProgressView', '~> 0.1.0'
end

target 'testTests' do

end

use_frameworks!添加到您 Podfile

这篇关于从pod依赖项中使用IB_DESIGNABLE实时渲染自定义组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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