iOS private library package

One: creating a Cloud Storage (used here is Tencent cloud developer platform code City)

 

 

Two: Create a local library spec

     The so-called Spec Repo, is the Podsindex. Once podfileset sourceto the address of a private git repo of performing pod updatewill go this time repoin the retrieval, if the corresponding retrieved pod, which reads Podthe podspecthus install

     Create a local spec library

 

 

 

pod repo add [private library name] [cloud repository URL]

 

     Check whether to create success

View source pod pod repo # 

master # Total - Main 
- Type: git (Master) 
- the URL of: https://github.com/CocoaPods/Specs.git 
- Path: /Users/imac/.cocoapods/repos/master 

tencent- ** # private library, you need to create your own 
- Type: git (Master) 
- the URL of: https://git.dev.tencent.com/**/*Spec.git 
- Path: /Users/imac/.cocoapods/repos / ** spec

 

Three: Create a local pod project files - "project file name itself is defined here in order to show convenient to [ABC], instead of the name of the project."

1: Create an empty folder, its own name, and a terminal, cd to this document [the ABC] in

pod lib create ABC

 Terminal will ask you the following information

 

 

 

After usually create success, successful, go [ABC] file

 

 

 

将你所有封装的私有库所有相关的文件都添加到【ABC】私有库文件中

 

编辑并运行你demo工程,将报错的地方

 

 

 

 

 

注意 ⚠️:读取相关图片文件的时候,需要使用以下方法去读取资源

[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:name ofType:@"name"]]

 

[UIImage imageNamed:<#(nonnull NSString *)#>]失效

 

四:将第三部的项目文件同步到git上去,这里是使用SourceTree管理云端项目

    1:在你需要存放云端项目的地方新建一个空文件夹【ABC】,将步骤一中创建仓库的https链接,使用sourceTree将云端仓库和本地仓库关联上

 

 

2:进入之前编辑的项目ABC,删除.git版本信息记录文件,将其他所有文件拷贝到步骤四-1中新建的文件中【ABC】中

 

 

#在终端中输代码

#显示隐藏文件
defaults write com.apple.finder AppleShowAllFiles -boolean true;killall Finder

#再次隐藏文件,可以输入命令
defaults write com.apple.finder AppleShowAllFiles -boolean false;killall Finder

 

3: SourceTree 上传项目文件

 

五:编辑ABC.podspec文件

 

Guess you like

Origin www.cnblogs.com/nelsen-chen/p/11975444.html