Latest 0.0.1
License MIT
Platforms ios 6.0

A automatically reference manager for icon image.



Author: @冷秋 @Forever波波哥哥

Usage 使用


pod 'HXImage'
#import <HXImage.h>

If you import HXImage with CocoaPods, the Plan-C will be used.

使用 CocoaPods 会自动导入 Plan C 目录


Drag any Plan folder(Plan C for best) into your project.

选择任意 Plan 目录(推荐 Plan C), 导入到工程中:

#import "UIImage+HXImage.h"

Release Your Image File

HXImage is not supporting image in So you must release your image to the main bundle.

HXImage 不支持 中的文件,所以你必须把图片文件放到 Bundle 中。

Create UIImage Instance

Create an UIImage instance.

创建 UIImage 对象

// default
UIImage *image = [UIImage hx_imageNamed:@"image"];

// in special folder
UIImage *image = [UIImage hx_imageNamed:@"image" inDirectory:@"Documents"];

// contents of file
UIImage *image = [UIImage hx_imageWithContentsOfFile:@"path/to/image"];
  • The image will be dealloc atomically if there is not any reference to the instance.
  • 当没有任何引用到 image 对象时,该对象会自动销毁
// default
UIImage *image = [UIImage hx_imageNamed:@"image"];
image = nil; // call -[UIImage dealloc]
  • The same image will not be created
    before dealloc.
  • 在旧的图片销毁之前,重复取相同名字的图片,不会用到多余的内存
//  repeat creating
UIImage *image = [UIImage hx_imageNamed:@"image"];
UIImage *newImage = [UIImage hx_imageNamed:@"image"]; // image == newImage
image = nil;
newImage = nil; //  call -[UIImage dealloc]

Latest podspec

    "name": "HXImage",
    "version": "0.0.1",
    "summary": "A automatically reference manager for icon image.",
    "description": "1. Dealloc image atomicallyn2. Reuse image if repeat create.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "u51b7u79cb": "[email protected]"
    "platforms": {
        "ios": "6.0"
    "source": {
        "git": "",
        "tag": "0.0.1"
    "source_files": "HXImage/**/*.{h,m}",
    "public_header_files": "HXImage/Public/*.h"

Pin It on Pinterest

Share This