Skip to content

Subclass of UIImageView to drive easy animations (manual rotation, Carousel, GIF support)

License

Notifications You must be signed in to change notification settings

PigRiver/JMAnimatedImageView

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JMAnimatedImageView

JMAnimatedImageView is a performant subclass of UIImageView:

  • Plays huge image animation using a minimum memory pressure,
  • Allows manual interactions with imageView to drive manualy animations,
  • Can use has a Carousel,
  • GIF are supported to load your animations.

Installation & Usage

Simply replace your UIImageView instances with instances of JMAnimatedImageView.

If using CocoaPods, the quickest way to try it out is to type this on the command line:

$ pod try JMAnimatedImageView

In your code, #import "JMAnimatedImageView.h" and #import "JMAnimatedImageView.h"

//GIF example
@property (weak, nonatomic) IBOutlet JMAnimatedImageView *jmImageView;

[self.jmImageView reloadAnimationImagesFromGifNamed:@"rock"];
self.jmImageView.animationType = JMAnimatedImageViewAnimationTypeAutomaticLinearWithoutTransition;
[self.jmImageView startAnimating];
//PNG example with manual animation
@property (weak, nonatomic) IBOutlet JMAnimatedImageView *jmImageView;

self.jmImageView.animationDelegate = self;
self.jmImageView.animationDatasource = self;
[self.jmImageView reloadAnimationImages]; //<JMOImageViewAnimationDatasource>
self.jmImageView.animationType = JMAnimatedImageViewAnimationTypeAutomaticLinearWithoutTransition;
self.jmImageView.memoryManagementOption = JMAnimatedImageViewMemoryLoadImageLowMemoryUsage;

Some parameters :

  • AnimationType
typedef NS_ENUM(NSUInteger, JMAnimatedImageViewAnimationType) {
    JMAnimatedImageViewAnimationTypeNone = 0,
    
    //Animation, carousel effect
    JMAnimatedImageViewAnimationTypeManualSwipe, 
    
    //Automatic rotation, use animationDuration + animationRepeatCount
    JMAnimatedImageViewAnimationTypeAutomaticLinear,    
    JMAnimatedImageViewAnimationTypeAutomaticLinearWithoutTransition,
    JMAnimatedImageViewAnimationTypeAutomaticReverse,
};
  • MemoryOption
typedef NS_ENUM(NSUInteger, JMAnimatedImageViewMemoryOption) {
    //images memory will be retain by system
    JMAnimatedImageViewMemoryLoadImageSystemCache = 0, 
    
    //image are loaded in live
    JMAnimatedImageViewMemoryLoadImageLowMemoryUsage,
    
    //you load your images has you want
    JMAnimatedImageViewMemoryLoadImageCustom
};
  • ImageViewOrder
typedef NS_ENUM(NSUInteger, JMAnimatedImageViewOrder) {
    JMAnimatedImageViewOrderNormal = 1,
    JMAnimatedImageViewOrderReverse = -1
};

Multi Gif and animation type (top interactive, leff automatic swipe effect, right automatic without animation)

Image

JMimageView can generate Carousels

Image

JMimageView allows interactive animations

Image

About

Subclass of UIImageView to drive easy animations (manual rotation, Carousel, GIF support)

Resources

License

Stars

Watchers

Forks

Packages

No packages published