STScratchView 1.1.0

STScratchView 1.1.0

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最新发布2014年12月

Seb C. Thiebaud 维护。



  • By
  • Sebastien THIEBAUD

一个 UIView,它允许手动和自动刮擦行为。

STScratchView screenshot

安装

我喜欢 CocoaPods,你也会。在 .podspec 文件中添加一行 'STScratchView'。

文档

您只需要 2 个文件

  • STScratchView.h
  • STScratchView.m

您需要创建一个 UIView(例如,子 UIView:UIImageView)并使用 -[STScratchView setHideView:(UIView *)hideView] 方法将此视图传递给 STScratchView 对象。

您还可以定义一个 UIBezierPath,以通过 -[STScratchView setAutomaticScratchCurve:(UIBezierPath *)curvePath duration:(float)duration] 创建自动刮擦。

官方文档在此处可用:http://doc.sebastienthiebaud.us/Classes/STScratchView.html

演示

构建并运行 Xcode 中的 STScratchViewExample 项以查看 STScratchView 的实际效果。

示例使用

    STScratchView *scratchView = [[STScratchView alloc] initWithFrame:CGRectMake(20.0, 60.0, 280.0, 200.0)];
    [self.view addSubview:scratchView];

    UIView *hideView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 280.0, 200.0)];
    [hideView setBackgroundColor:[UIColor redColor]];

    [scratchView setHideView:hideView];

非常简单!

联系方式

Sebastien Thiebaud

许可证

STScratchView 在 MIT 许可证下提供。