SimpleBlockDrawing 1.0.3

SimpleBlockDrawing 1.0.3

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

Marc Hervera 维护。



  • 作者:
  • Marc Hervera

使用最简单的方法在UIView上绘图的分类

用法

导入

    #import "UIView+DrawBlock.h" 

使用它!返回一个包含绘图的UIView的block。

    [viewToDraw drawInside:^(CGContextRef context, CGRect rect) {

        // Draw
        CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor);
        CGContextSetLineWidth(context, 5.0);
        CGContextBeginPath(context);
        CGContextMoveToPoint(context, 0.0, 0.0);
        CGContextAddLineToPoint(context, 100.0, 100.0);
        CGContextStrokePath(context);

    } withResult:^(UIView *view) {

        // Do what you want!

    }];

要求

需要Xcode 5,目标为iOS 6.0或更高版本

联系方式

Bitdeli Badge