GoKit 1.0.5

GoKit 1.0.5

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布最新发布2016年9月

Agoer 维护。



GoKit 1.0.5

  • 作者
  • Agoer

GoKit 是一个 UIKit 扩展库,它增加了一些常用的 UIKit 辅助功能

用法

安装

将依赖项添加到您的 Podfile

pod 'GoKit'

接下来,将头文件导入到您需要使用它的任何位置。

#import <GoKit/GoKit.h>

功能

UIColor 扩展

带十六进制数字的颜色

[UIColor go_colorWithHex:0x8031CCA]; // ARGB
[UIColor go_colorWithHex:0x31CCAA];  // RGB

UIView,带有模糊:为了适应 iOS 7 中的模糊效果,使用了半透明替换

有朋友问,为什么这样做? 我看到了许多 git 小伙伴写了一些替代方案,对 UIimage 进行处理,这是非常耗费性能的做法。为了适应 iOS7 而得不偿失。 UIVisualEffectView 是在 UIView 上覆盖了一层,对下面的 UIImageView 不进行操作。因此,它可以适用于快速切换效果

- (UIView *)go_addBlurWithEffectWithStyle:(UIBlurEffectStyle)style
                                frame:(CGRect)frame {
 if (go_iOS(8)) {

UIVisualEffectView *view = [self effectviewWithframe:frame];

[self addSubview:view];

return view;
 } else {

UIView *view = [self effectviewForiOS7Withframe:frame];
[self addSubview:view];

return view;

} }