Modify existing pod in xcode

左心房为你撑大大i 提交于 2019-12-09 22:02:04

问题


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?


回答1:


You should not do it this way, you should just extend the class from the pod you are using your project and add the necessary change in the derived class.




回答2:


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.

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




回答3:


#import "MyProjectClass.h" 

Directly import source, you should not use pods. Better to drag the source code, and directly put into you project.

If needed modify pods and you seldom pod install, change the mode of pod file.

cd your pod folder, and run sudo chmod 777 your folder.

Pods folder is readonly default.



来源:https://stackoverflow.com/questions/28625579/modify-existing-pod-in-xcode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!