NACommonUtils
Swift 实用工具和扩展,用于多个 iOS 应用
实用程序 | 注释 |
---|---|
ActivityOverlay | MBProgessHUD 的轻量级版本 - 显示一个半透明的 HUD,包含活动指示器,居中在指定的视图中 |
Array+Functional | func headTail() -> (head: Element, tail: [Element])? ;非变异版本的 arrayByAppend 和 arrayByAppendContentsOf 类似于 stdlib 的 append 和 appendContentsOf |
NSMutableAttributedString+Creation | NSMutableAttributedString 创建辅助工具 |
OnePixelConstraint | 设计为一个自动布局宽度和高度约束,无论屏幕缩放如何,总是为 1px |
String+LineUtils | 字符串行辅助工具 |
UIButton+ActionBlock | 按钮按下:块扩展 |
UIGestureRecognizer+ActionBlock | 手势识别器块扩展 |
UIResponder+FindUIViewController | 沿着响应链前进直到找到一个 UIViewController ;当 UIView 需要访问 UIViewController API 时很有用 |
UIView+Autolayout | 自动布局辅助工具;useAutolayout() 、centerInView(..) 、constrainToWidth(..) 、constrainToHeight(..) |
KeepInMemoryMixin | 类混合到允许类在内存中保持自身 |
UIView+NibLoading | instanceFromNib() 从名为与类同名的一個 nib 中加载视图实例。 |
UILabel+Measurement | 文本大小测量 |
安装
这些实用工具作为 Cocoapod 提供。要将它们整合到您项目中,请将以下内容添加到您的 Podfile
中,例如
target '<YourProject>' do
pod 'NACommonUtils'
.
.
end
有关更多详情,请参阅 nickager.com/blog/2016/03/04/NACommonUtils