Last active
January 26, 2016 21:58
-
-
Save Erkened/e70d518e8167bc56fd3d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HOW TO USE PRIVATE COCOAPODS | |
// SOURCE: http://albertodebortoli.github.io/blog/2014/03/11/cocoapods-working-with-internal-pods/ | |
// SOURCE: https://coderwall.com/p/7ucsva/private-cocoapods | |
// SOURCE: http://product.hubspot.com/blog/architecting-a-large-ios-app-with-cocoapods | |
0. INSTALL COCOAPODS | |
sudo gem install cocoapods | |
1. CHECK REPOS LOCATION, WHICH SHOULD BE EMPTY | |
cd ~/.cocoapods/repos/ | |
ls | |
1.1 IF REPOS ALREADY EXIST, REMOVE THEM AND CLEAN INSTALL | |
pod repo remove master | |
pod setup | |
ls | |
=> 'master' should appear | |
2. CREATE 'TOPPROJECT' SWIFT PROJECT AND CHECK GIT VERSIONING | |
3. CREATE FOLDER 'MODULES' INSIDE TOPPROJECT | |
4. CREATE 'MODULE1' SWIFT PROJECT INSIDE MODULES FOLDER AND CHECK GIT VERSIONING | |
5. CREATE PODFILE | |
cd into topproject folder | |
pod init | |
6. FILL IN PODFILE. EXAMPLE: | |
# Uncomment this line to define a global platform for your project | |
platform :ios, '9.0' | |
# Uncomment this line if you're using Swift | |
use_frameworks! | |
target 'TopProject' do | |
pod 'Module1', :path => 'Modules/Module1' | |
end | |
7. CREATE THE MODULE1 PODSPEC | |
cd into module1 folder | |
pod spec create Module1 | |
8. ADAPT THE MODULE1 PODSPEC | |
Change the location of the git url, the files included etc. Make sure to point s.source_files to Module1/*.swift | |
9. GO BACK TO THE TOPPROJECT FOLDER AND INSTALL | |
cd into topproject folder | |
pod install | |
10. ONLY USE THE .XCWORKSPACE FILE WHEN WORKING ON TOP PROJECT. | |
11. ADD import Module1 WHEREVER NEEDED AND CLEAN/BUILD TO REMOVE THE ERROR | |
12. REMEMBER TO DECLARE VARIABLES AND FUNCTIONS AS PUBLIC IN MODULE1 FILES IF YOU WANT TO ACCESS THEM | |
13. UPDATE THE MAIN PROJECT IN ORDER TO ACCESS NEW DEVELOPMENTS IN THE MODULES | |
pod update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment