简体   繁体   中英

Modify existing pod in xcode

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?

您不应该这样做,您应该只从您正在使用项目的pod中扩展该类,并在派生类中添加必要的更改。

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

#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.

IMG

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM