Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoapods: what is the best way to modify the resources

I'm using cocoapods to manage third party libraries for my iOS project. The resources (e.g. images) are located in the Pods project. Now if I want to replace some of those resources, for example bg-addbutton.png in the snapshot, what would be the best way to do? I'm thinking of replacing the resources directly in the Pods project, but the new resources will be overwritten if I upgrade the libraries later on.

enter image description here

like image 285
darcyy Avatar asked Sep 20 '13 12:09

darcyy


People also ask

What does ~> mean in CocoaPods?

~> (the optimistic operator) is used when you want to specify a version 'up to next major | minor | patch'. For example: ~> 0.1.2 will get you a version up to 0.2 (but not including 0.2 and higher) ~> 0.1 will get you a version up to 1.0 (but not including 1.0 and higher)

How do I edit a Podfile?

Edit a Podfile To open the existing Podfile for editing: From the main menu, select Tools | CocoaPods | Edit Podfile.

What command updates a single library in CocoaPods?

$ pod update It will update the pod to the latest version possible (as long as it matches the version restrictions in your Podfile). If you run pod update without any pod name, CocoaPods will update every pod listed in your Podfile to the latest version possible.

How do you add dependency in CocoaPods?

After you have initially installed CocoaPods into your project, you can add new dependencies (or remove unused ones) by editing the Podfile. Then simply run pod install again.


2 Answers

What I usually do is forking the 3rd party project (probably on GitHub) and push the changes to my fork. Then, on Podfile you just point to your repo:

platform :ios, '6.0'

pod 'MyAwesomeLib', :git => 'https://github.com/myuser/MyAwesomeLib'
like image 63
Marcelo Fabri Avatar answered Nov 10 '22 00:11

Marcelo Fabri


You can move that pod locally to you machine local directory and make changes in that particular pod and install pod from your local path. For perform this you need pod project download from git with .podspec file.

  • For install pod use below statement.

pod 'PODNAME', :path => "LOCAL POD PATH"

PODNAME :- Same aa pod name from you downloaded pod file. LOCAL POD PATH :- Pod directory which contains .podspec file.

like image 25
Dhaval Patel Avatar answered Nov 10 '22 02:11

Dhaval Patel