修改xcode中的现有容器 [英] Modify existing pod in xcode

查看:83
本文介绍了修改xcode中的现有容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Xcode处理项目,我需要导入在pod类中的项目类头。

Working on a project in Xcode, I need to import a project class header in a pod class.

很明显,如果我使用:

Obviously if I use:

#import "MyProjectClass.h" 

失败。我必须在哪里指定路径?

fails. Where I have to specify path?

推荐答案

Pods不应直接编辑,因为任何后续的 pod安装都会清除您的更改。如rckoenes所述,最简单的方法是对相关类进行子类化并添加所需的内容。

Pods should not be directly edited, as any subsequent 'pod install' will wipe out your changes. As stated by rckoenes the easiest approach is to subclass the relevant class and add what you need.

如果无法在子类中完成所需的更改,则可以选择其他方法。您可以为Pod分叉存储库,直接对类本身进行任何所需的更改,然后将Podfile指向分叉。看到以下答案: Cocoapods和github分支

If the changes you need can't be done in a subclass, you have another option. You can fork the repo for the pod, make any needed changes directly to the classes themselves, and point your podfile towards your fork. See this answer: Cocoapods and github forks

这篇关于修改xcode中的现有容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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