This article explains how to use the main local library cocoapods
Article Directory
1, create a whole file structure
- First, choose a location to create a folder, for example: CocoapodsProject;
- cd to the "CocoapodsProject" path, and then create a file library file storage folder, here named "TestLibrary";
- Use Xcode to create a Project, named here as "TestDemo";
After completion of the above steps, as shown below:
2, create a local library
- Open to the lower terminal cd "TestLibrary";
- Create a file repository folder, here to "Classes" for example;
- The project requires the use of the relevant SDK, source code, resources into "Classes" folder;
- cd to "Classes" on a path;
- Create a file `` podspec```
pod spec create TestLibary //创建podspec文件
After completion of the structure as shown below:
3, modify the file podsec
- Modify the configuration file description
- Modify the source configuration
- Modify project linking problem
4, uses its own library project
- cd root path to the project, and then perform "pod init" command
# 切到项目根路径
cd TestDemo
# pod初始化
pod init
- Modify Podfile file as follows
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'TestDemo' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for TestDemo
pod 'TestLibrary', :path=>'../TestLibrary'
end
- In the library project to install root path
pod install
- FIG terminal after executing the following
This allows the use of their own local library