Reputation: 620
I've been working on a mobile app for a couple of months. Now I want to develop other apps but reusing the code I've written. I'd like to have reusable code (ViewControllers) in order to be used in many projects. In this way, if there is some bug in one of these, I'd fix the bug and then apply the changes to all the projects that use my library. In short words, I'd like to know what is the best way to develop my own library for iOS with XCode. I've been developed for Android but I'm new in iOS development.
Thank you very much
Upvotes: 5
Views: 1018
Reputation: 26395
You can create a static library or a framework (shared library). From the "File" menu choose "New Project" and then click on "Framework&Library" under "iOS". Then choose "Cocoa Touch Static Library" or "Cocoa Touch Framework".
Upvotes: 2
Reputation: 1549
Yes, you can create your private, internal, pods and make your applications depend on them. As an alternative you could use git submodules either.
But if you want you can even use both: having your private pods
, which are also git submodules of your project, - they are usually called Development Pods - because you might want to fix a bug on your internal pod and push the fix immediately to the bleeding edge of your library as soon as you tested it on the application in which you spotted the bug in the first place.
A couple of interesting articles on this topic:
On a totally side and obvious - I think - note, you can do this manually as pointed out by user1118321.
Upvotes: 4