ESBlur
是一个简单的分类,可以从任何 UIView
创建模糊视图。它基于 UIImageEffects
类,并支持 iOS 7 及以后的版本。
在您想要应用模糊的类中导入 UIView+ESBlur.h
#import <ESBlur/UIView+ESBlur.h>
模糊可以应用于任何 UIView
或其子类
UIView *blurredView = [someView viewByApplyingBlur];
如果要使用自定义的色调颜色而不是默认颜色,可以调用
UIColor *tintColor = [UIColor greenColor]; // Just any UIColor.
UIView *blurredView = [someView viewByApplyingBlurWithTintColor:tintColor];
此库可在MIT 许可证下使用。