Tools v0.0.1
更新
2018.03.21更新:
- 日期扩展逻辑细节优化。
使用
1.CocoaPods
Objective-C
pod 'JLTools_OC'
Swift
pod 'JLTools_Swift'
2.使用说明
-
方法调用
-
初始化方法直接调用即可。例如:
let label = UILabel(text: "label", textColor: .lightGray, font: UIFont.systemFont(ofSize: 18.0))
-
扩展方法调用需要通过
.urt
进行调用。例如:view.backgroundColor = UIColor.jlt.randomColor
-
-
使用配置
UIDevice+UUID.swift
工具包含Keychain存储功能,并支持**同组应用(同一证书打包)**共享钥匙串信息。在使用时,需要对此工程进行配置:- 在“Targets” -> “Capabilities” -> “Keychain Sharing”中打开“Keychain Sharing”开关。
- 将“Keychain Groups”的内容修改为统一的标识,例如:
com.company.Family
。
下一步
- 如果缺少特定功能,建议在此基础上进行
封装
或添加扩展
,尽量避免直接修改原有逻辑。 - 如果缺少所需的通用功能,可以提交
issue
。 - 如果扩展出现Bug或设计存在问题,请立即指出。
树
-
Swift版本
. |____Date+Extension.swift //日期扩展 |____Dictionary+Extension.swift //字典扩展 |____Encryption //文件夹 | |____String+Encryption.swift //加密扩展 包含 Base64 MD5 DES AES(128/192/256) |____Enum.swift //枚举 |____Global.swift //全局扩展 |____UIDevice+UUID.swift //设备扩展 |____RoundedCornersImageView.swift //圆角视图类 |____String+Extension.swift //字符串扩展 |____UIColor+Extension.swift // 颜色扩展 |____UIImage+Extension.swift // 图片扩展 |____UILabel+Extension.swift |____UIBarButtonItem+Extension.swift |____UIButton+Extension.swift |____UIView+Extension.swift
-
Objective-C版本
. |____Encryption //文件夹 | |____GTMBase64 //第三方库 | | |____GTMBase64.h | | |____GTMBase64.m | | |____GTMDefines.h | |____NSString+Encryption.h // 加密扩展 包含 MD5 DES AES(128/192/256) | |____NSString+Encryption.m |____Global.h //全局扩展 |____Global.m |____NSDate+Extension.h // 日期扩展 |____NSDate+Extension.m |____NSMutableDictionary+Extension.h // 字典扩展 |____NSMutableDictionary+Extension.m |____NSString+Extension.h // 字符串扩展 |____NSString+Extension.m |____UIColor+Extension.h // 颜色扩展 |____UIColor+Extension.m |____UIImage+Extension.h // 图片扩展 |____UIImage+Extension.m |____UIImageView+CornerRadius.h // 圆角视图扩展 |____UIImageView+CornerRadius.m |____UILabel+Extension.h |____UILabel+Extension.m |____UIView+Extension.h |____UIView+Extension.m |____UIButton+Extension.h |____UIButton+Extension.m |____UIBarButtonItem+Extension.h |____UIBarButtonItem+Extension.m