ScratchImage 是可擦除的 UIImageView
截图
用法
初始化
let scratchImage = ScratchImageView(image: UIImage(named: "image"))
let scratchImage = ScratchImageView(imageColor: .brown)
重置
scratchImage.reset()
擦除百分比
scratchImage.scratchedPercent
线条
// line type
scratchImage.lineType = .square // .butt, .round
// line width
scratchImage.lineWidth = 10.0
安装
CocoaPods (iOS 8及以上版本)
platform :ios, '8.0'
use_frameworks!
target '<Your Target Name>' do
pod 'ScratchImage'
end
Carthage (iOS 8及以上版本)
github "cashwalk/ScratchImage"
授权
这些作品可在MIT授权下使用。更多信息请参阅授权文件。