Latest 1.0.3
Homepage https://github.com/mhergon/SimpleBlockDrawing
License MIT (LICENSE)
Platforms ios 6.0, requires ARC
Authors

Category for drawing on UIView with a simplest way

Usage

Import

    #import "UIView+DrawBlock.h" 

Use it! Result block returns a UIView added to original view with the drawing.


    [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!

    }];

Requirements

Requires Xcode 5, targeting either iOS 6.0 and above

Contact

Bitdeli Badge

Latest podspec

{
    "name": "SimpleBlockDrawing",
    "version": "1.0.3",
    "summary": "Category for drawing on UIView with a simplest way",
    "description": "                   Category for drawing on UIView with a simplest way.n",
    "homepage": "https://github.com/mhergon/SimpleBlockDrawing",
    "license": "MIT (LICENSE)",
    "authors": {
        "Marc Hervera": "[email protected]"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source": {
        "git": "https://github.com/mhergon/SimpleBlockDrawing.git",
        "commit": "c9a28737efee40c87d898f490031fa114e34a0c0",
        "tag": "1.0.3"
    },
    "source_files": [
        "UIView+DrawBlock.h",
        "UIView+DrawBlock.m"
    ],
    "requires_arc": true
}

Pin It on Pinterest

Share This