Latest 1.0
Homepage https://github.com/alexsteinerde/SWNinePatchImageFactory
License Apache License, Version 2.0
Platforms ios 7.1
Authors

Let you use 9-Patch PNG images easily on iOS.

The techinque is only to transform the 9-patch PNG images to iOS compatible, resizable UIImage objects.
See the UIImage’s method resizableImageWithCapInsets:(UIEdgeInsets)insets for more info.
So it only support to stretch one segment of patch markers in both horizontal and vertical sides.

INSTALL

Copy the files under SWNinePatchImageFactorySample/SWNinePatchImageFactory/

USAGE

Use the SWNinePatchImageFactory class to create resizable UIImage from 9-patch PNG images.

@interface SWNinePatchImageFactory : NSObject

+ (UIImage*)createResizableNinePatchImageNamed:(NSString*)name;
+ (UIImage*)createResizableNinePatchImage:(UIImage*)image;

@end

Or directly use the SWNinePatchImageView class as the custom class in your Interface Builder,
and also put the image’s filename in its image field.

You can check out the both ways in the sample project.

LICENSE

Copyright 2014 shiami.
Licensed under the Apache License, Version 2.0.
See the LICENCE file for more info.

Latest podspec

{
    "name": "SWNinePatchImageFactory",
    "version": "1.0",
    "summary": "Let you use 9-Patch PNG images easily on iOS.",
    "description": "The techinque is only to transform the 9-patch PNG images to iOS compatible, resizable UIImage objects. See the UIImage's method resizableImageWithCapInsets:(UIEdgeInsets)insets for more info. So it only support to stretch one segment of patch markers in both horizontal and vertical sides.",
    "homepage": "https://github.com/alexsteinerde/SWNinePatchImageFactory",
    "license": "Apache License, Version 2.0",
    "authors": {
        "Alex Steiner": "[email protected]"
    },
    "platforms": {
        "ios": "7.1"
    },
    "source": {
        "git": "https://github.com/alexsteinerde/SWNinePatchImageFactory.git",
        "tag": "1.0"
    },
    "source_files": [
        "SWNinePatchImageFactorySample/SWNinePatchImageFactory",
        "SWNinePatchImageFactorySample/SWNinePatchImageFactory/**/*.{h,m}"
    ],
    "exclude_files": "SWNinePatchImageFactorySample/SWNinePatchImageFactorySample"
}

Pin It on Pinterest

Share This