How to use development pods across our team? - ios

When I set path for my development pod, I cant commit podfile - it will break pod install for other devs. So I keep podfile in another change list and its really annoying. Is there a better way to develop pod?
I found this: link, it suggest to change to path every time I want to update something in my pod. But it's even worth than uncommited podfile.

You can use relative paths for development pods.
You can ask your co-developers to always use the same folder hierarchy between your current project (with the podfile) and the others developments projects/pods (with the podspec).
You can also use Repo to automatically do it for you (could be useful when a new guy comes, and/or if you have plenty of different development pods). It will install different projects/(development)pods according to the hierarchy set in its manifest. You can check this related answer if needed.

Related

Editing pods in xcode project - enabling edits to be compiled

I often use pods in my Obj-C and Swift projects and quite often need to tweak a pod for my use-cases. I noted recently that my edits were having no effect, that the original bits were being used, and there were many times I was stumped at a situation that I thought my editing corrected, only to realize the compiled bits did not include my latest brilliant hack.
Then I discovered that simply cleaning the build folder (shift-cmd-K) will reset everything and the next build incorporates my edits. I now do this as a matter of regular business with each pod edit, but wondered if there was a simpler way to set a pod to be included in each rebuild.
Editing pods is not ideal, simply because all your changes will be removed after the next pod update.
The best way here would be to fork the pod, modify it and use your own version instead.

Editing locked files from a CocoaPods framework

I have an Xcode workspace that uses CocoaPods to include several third-party frameworks. I would like to edit a line of source code within one of these dependencies. However, when I do so, Xcode warns me that the file is locked and that any changes I make may not be saved. So my question is: will my changes to the source code be discarded when I run a pod install/update? If not, is there any other scenario, possibly unrelated to CocoaPods, that would discard my changes? And finally, is there any good way that I can edit the source code without running into such problems?
Thanks in advance.
You can not make changes in Original Pod file. If you want to add some more features then you have to fork that particular repo.
Follow steps to do so :
Find library you want to use on Git.
Fork library.
Update Podfile which refer to your forked version.
Suppose I want to fork GPUImage Library. Then point your fork in Podfile as given.
pod 'GPUImage', :git => 'https://github.com/UserName/GPUImage.git'
Make your changes.
Commit/push your changes to your forked repo.
Submit a pull request to the original author of Library.
If pull request is accepted and the pod is updated, revert back your Podfile to use the public pod.
You can create Category (Objective C) or Extension (Swift) to extend or add some features to existing class.
You can do this simple. Just modify the pods src code. Switch to another brach and switch back. Xcode would rebuild pods with your modified code.
If you want go back, you should remove the pod in Podfile, execute pod install.Then add pod back, execute pod install.
This solution is just for debug.
For permament, you should take #technerd 's answer
In fact there is another way in which you can modify the library as per your custom needs and get future updates from the library, all while still maintaining it via cocoapods
I have written article/tutorial explaining the same.
https://medium.com/#mihirpmehta/how-to-modify-cocoapods-library-within-pods-647d2bf7e1cb

Prevent XCode from collapsing my folders whenever workspace file is rebuilt with CocoaPods

Whenever I add a CocoaPod to my workspace using pod install, the folders tree on the left navigator collapses to the root. This is very annoying because I am working in a project with a deep folder structure. I realize its a minor inconvenience, but is there any way to prevent this from happening?
EDIT: So, I have a workspace that already has been setup with CocoaPods via pod install. I want to add a new pod. So, I vim Podfile and then pod install (or sometimes pod update).
In the meanwhile, since the last pod install, I've done some work. I have some tabs open in my XCode workspace, and each tab has its own left navigation view that shows a hierarchical representation of my workspace. You know, something like this:
If it matters, I take great care to ensure that my project has groups that are strictly representative of file system folders - that is, under the project node, each group corresponds to a real file system folder. I doubt it is relevant but just in case, I mention it.
Now once I run that pod install, right when it finishes, I believe it either writes to or overwrites the xcworkspace file. And I always know it when i happens, because what happens next is that my left navigation view is totally collapsed. I can't find a picture of it online immediately, but basically picture the above with only "SlideApp" and the Pods project visible.
The user interface state is preserved within you *.xcodeproj->project.workspace->xcuserdata->'user'.xuserdatad->UserInterfaceState.xuserstate
Where 'user' should be your login I'd.
If you are so particular about your state then try to backup and install the state after install.
Your user interface state prior to pod install/update might not be same as after the install as naturally pod install/update causes change in user interface. So the result might not be reproducible.
We had a developer commit his userdata while he was searching. Made it seem like the app directory was unaccessible.

How do I incorporate a custom control from github to my project and stay up to date

I use a couple of custom controls from github, thus far I've always added source code files as new resources to my project in XCode. But I have now seen this repo getting updated frequently, it made me wonder if I can add source files and get them updated (manually or automatic) when something new is pushed. Sorry it might be a noob question.
This is the repo : BlockAlertsAnd-ActionSheets
Sounds like you want a git submodule.
As far as I know, there's no way to do this within Xcode, so you'd need to do this from the command line.
And if you're comfortable with using git via the Terminal command line, here's a tutorial on how to get this set up.
you can use CocoaPods. and there is a pod for this repo.
it's really useful to manage your dependencies. to get a new version of a pod, you'll need just update your Podfile and run 'pod install'. Check the website, you'll find more info there.

How to handle merge conflicts in Xcode "pbxproj" file?

Everytime I do a pull, there is a merge conflict from my other team member.. And I've tried to manually remove the ==== and >>>>'s but Xcode will never open the file after this.
I am just curious, is this a problem that EVERY iOS person on a team deals with? Is there any sort of tip or trick to avoid this nonsense? It's seriously slowing down my productivity by a huge amount.
You just need a good merge tool. I use p4merge: http://www.andymcintosh.com/?p=33 contains a guide to integrating it with Git.
these two can go a long way:
rely on the xcode project less, such that you could reconstruct a project by adding a directory of stuff, then get it to build with minimal changes. a good example of this: define your build settings in xcconfigs.
simplify your projects. collisions will be reduced if you are developing separate components of the same larger project.
I ran into a merge conflict that had to do with our team's cocoapods integration. After running pod deintegrate and then pod install again the .pbxproj file was parsable again.

Resources