ASMaskImageView 1.1.0

ASMaskImageView 1.1.0

测试已测试
语言语言 SwiftSwift
许可证 自定义
发布最新发布2016年9月
SPM支持 SPM

zkhCreator 维护。



  • 作者
  • 创建者

ASMaskImageView


English Version README.MD

一个简单的页面遮罩效果类,主要用于 UIImageView 与对 UILabel 中的文字的遮罩。支持圆角切割,支持透明背景图片,支持移动效果。

效果图

showImage

安装方法


cocoapods

pod 'ASMaskImageView', '~> 1.0.0'
use_frameworks!

使用方法


创建需要用于遮罩的 MaskView 对象(该对象继承于 UIImageView)

touchView = MaskView.init(image:UIImage.init(named: "1")!,frame: CGRect.init(origin: CGPoint(x: 0,y: 0), size: CGSize(width: 100, height: 100)))

将需要被遮罩的 UILabel 控件加入 MaskView 对象maskViewArray 属性中

touchView!.maskViewArray.append(label1)
touchView!.maskViewArray.append(label2)
touchView!.maskViewArray.append(label3)

当需要使用遮罩效果时,调用 changeMoveImage() 方法即可

func move(gesture:UIPanGestureRecognizer)throws {
    touchView?.center = gesture.locationInView(self.view)
    try touchView?.changeMoveImage()

}