HLChineseLog
在调试方案中轻松记录中文
ViewController.m:44 (
"\U4e2d\U56fd",
"\U4e2d\U56fd\U4eba",
{
"\U4e2d\U56fd" = "\U5f3a\U5927";
"\U4e2d\U56fd\U4eba" = (
"\U52e4\U52b3",
"\U52c7\U6562"
);
}
)
HLChineseLogDemo[8895:252874] (
中国,
中国人,
{
中国人 = (
勤劳,
勇敢
);
中国 = 强大
}
)
使用说明
pod 'HLChineseLog'
###简要说明CocoaPods 创建公共库情况 第一次 使用CocoaPods创建公共库,所以用这个简单的东西 $pod search [HLChineseLog] 中[HLChineseLog] 表示HLChineseLog替换成你想输入的参数
使用CocoaPods创建公共库 首先感谢 https://www.jianshu.com/p/d2d98298b1b8
其次英文好的完全可以去https://cocoapods.org.cn
1. 要创建 CocoaPods 公共库,首先要注册 CocoaPods 账号
$ pod trunk register [GitHub_email] [user_name] --verbose
例:pod trunk register [email protected] lhkzhl --verbose
然后登录邮箱点击验证
2. pod trunk me 查看注册信息
失败:[!] Authentication token is invalid or unverified. Either verify it with the email that was sent or register a new session.
**遇到这种情况请执行第一步**
成功:会有Name,Email等信息
3. 在 GitHub 创建 Git 仓库
创建Git仓库需要包含几个文件,a,b,c 应该都知道,主要说d
a.license:开源许可证
b.readme.md
c.你的代码
d.*.podspec 如HLChineseLog.podspec
创建.podspec 文件
$ pod spec create [fileName]
eg:pod spec create HLChineseLog
修改.podspec文件, 使用vim修改.podspec
Pod::Spec.new do |s|
s.name = "HLChineseLog" # 项目名称
s.version = "0.0.1" # 版本号 与 你仓库的 标签号 对应,发布cocoapod必备
s.license = "MIT" # 开源证书 也可以选其它的
s.summary = "A delightful TextField of PhoneNumber" # 项目简介
s.description = <<-DESC
log chinese easy to use
DESC
# 在DESC之间写项目的description
s.homepage = "https://github.com/lhkzhl/HLChineseLog" # 你的主页
s.source = { :git => "https://github.com/lhkzhl/HLChineseLog.git", :tag => "#{s.version}" }#你的仓库地址,不能用SSH地址
s.source_files = "HLChineseLog/*.{h,m}" # 关键位置,pod install 要使用的代码的位置路径, HLChineseLog/*.{h,m} 表示 HLChineseLog 文件夹下所有的.h和.m文件,
s.requires_arc = true # 是否启用ARC
s.platform = :ios, "7.0" #平台及支持的最低版本
s.frameworks = "UIKit", "Foundation" #支持的框架
# s.dependency = "AFNetworking" # 依赖库
# User
s.author = { "lhkzhl" => "[email protected]" } # 作者信息,默认会有
end
4. 验证.podspec 文件配置是否正确
$pod lib lint 如果不正确按提示修改配置
5. 配置正确,发布之前必须 对仓库进行打标签 tag
$ git tag -a 0.0.1 -m [message]//创建标签 $ git push origin --tags//推送到远程
6. 发布 .podspec
pod trunk push [HLChineseLog.podspec] 如果成功可以到https://cocoapods.org.cn/pods/HLChineseLog 查看
7. 问题
虽然发布成功了, 但是别高兴太早, 虽然能看到, 但是在https://cocoapods.org.cn/ 上搜索不到, 我是第二天才搜索到的
第二天搜索到也不要高兴太早:
因为$pod search HLChineseLog 搜索不到
未找到匹配名称、作者、摘要或描述的库
1.pod setup
2.删除~/Library/Caches/CocoaPods目录下的search_index.json文件
重新$pod search [HLChineseLog]
耐心等待, 终于搜索到了