播放gif的UIImageView的子类 – UIImageView-PlayGIF

UIImageView-PlayGIF

播放gif的UIImageView的分类和子类。简单,高性能,低内存占用。

安装

pod 'UIImageView-PlayGIF', '~> 1.0.1'

使用方法

#import <UIImageView-PlayGIF/UIImageView+PlayGIF.h>

or#import <UIImageView-PlayGIF/YFGIFImageView.h>

  • 参数:
  • Pass value to one of them:
  • - gifData` NSData from a GIF
  • - gifPath` local path of a GIF
  • 方法:
  • - startGIF`
  • - stopGIF`
  • - isGIFPlaying`

===================

//
//  UIImageView+PlayGIF.h
//  UIImageView-PlayGIF
//
//  Created by Yang Fei on 14-3-25.
//  Copyright (c) 2014年 yangfei.me. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import <ImageIO/ImageIO.h>

@interface UIImageView (PlayGIF)
@property (nonatomic, strong) NSString          *gifPath;
@property (nonatomic, strong) NSData            *gifData;
@property (nonatomic, strong) NSNumber          *index,*frameCount,*timestamp;
- (void)startGIF;
- (void)stopGIF;
- (BOOL)isGIFPlaying;
@end
//
//  YFGIFImageView.h
//  UIImageView-PlayGIF
//
//  Created by Yang Fei on 14-3-26.
//  Copyright (c) 2014年 yangfei.me. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import <ImageIO/ImageIO.h>

@interface YFGIFImageView : UIImageView
@property (nonatomic, strong) NSString          *gifPath;
@property (nonatomic, strong) NSData            *gifData;
- (void)startGIF;
- (void)stopGIF;
- (BOOL)isGIFPlaying;
@end

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:播放gif的UIImageView的子类 – UIImageView-PlayGIF