CocoaPods trunk is moving to be read-only. Read more on the blog, there are 11 months to go.

NinePatchKit 2.1

NinePatchKit 2.1

Maintained by Theo.



  • By
  • Theo

NinePatchKit


NinePatch image parser and render framework for iOS & macOS

Multilingual translation

Chinese README

Main Features

  • parse png's binary data to get its chunk data
  • slice image according its npTc chunk, then draw them in rule
  • NinePatchImageView has its contentView like UITableViewCell, where you can place any UI object
  • support flip horizontally and vertically
  • support muliple platform
  • support auto layout

Requirements

  • iOS 9.0+
  • macOS 10.11+

Effects

Demo

Demo_for_mac

Installation

CocoaPods

The preferred installation method is with CocoaPods. Add the following to your Podfile:

pod 'NinePatchKit'
Manual

Copy NinePatchUtils directory in your project

Getting Started

#import <NinePatchKit/NinePatchKit.h>
...
NSString * path = [[NSBundle mainBundle] pathForResource:@"YourNinePatchImageName" ofType:@"png"];
NinePatchImageView * imageView = [[NinePatchImageView alloc] init];
imageView.showImage = [NinePatchUtils imageWithContentsOfFile:path];

License

NinePatchKit is MIT-licensed.