Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
leverdeterre committed Aug 20, 2014
2 parents ae9997e + 7e4ee50 commit e7dd619
Showing 1 changed file with 44 additions and 6 deletions.
50 changes: 44 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,61 @@
JMAnimatedImageView
==================

Subclass of UIImageView to drive easy animations.
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:

```shell
$ pod try JMAnimatedImageView
```

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

```objective-c
//GIF example
@property (weak, nonatomic) IBOutlet JMAnimatedImageView *jmImageView;

NSURL *url = [[NSBundle mainBundle] URLForResource:@"rock" withExtension:@"gif"];
NSData *data = [NSData dataWithContentsOfURL:url];
[self.jmImageView reloadAnimationImagesFromGifData:data];
[self.jmImageView startAnimating];
```
```objective-c
//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 = JMAnimatedImageViewAnimationTypeAutomaticLinearWithoutAnimation;
self.jmImageView.memoryManagementOption = JMAnimatedImageViewMemoryLoadImageLowMemoryUsage;
```


Some parameters :

* AnimationType
```objc
typedef NS_ENUM(NSUInteger, JMAnimatedImageViewAnimationType) {
//Animation is done by a Pan gesture
JMAnimatedImageViewAnimationTypeManualRealTime = 0,
//Animation is done by a gesture
JMAnimatedImageViewAnimationTypeInteractive = 0,

//Animation, carousel effect
JMAnimatedImageViewAnimationTypeManualSwipe,

//Automatic rotation, use animationDuration + animationRepeatCount
JMAnimatedImageViewAnimationTypeAutomaticLinear,
JMAnimatedImageViewAnimationTypeAutomaticLinearWithoutAnimation,
JMAnimatedImageViewAnimationTypeAutomaticReverse,
};
```
Expand All @@ -29,7 +69,7 @@ typedef NS_ENUM(NSUInteger, JMAnimatedImageViewMemoryOption) {
//image are loaded in live
JMAnimatedImageViewMemoryLoadImageLowMemoryUsage,
//you load your images
//you load your images has you want
JMAnimatedImageViewMemoryLoadImageCustom
};
```
Expand All @@ -44,8 +84,6 @@ typedef NS_ENUM(NSUInteger, JMAnimatedImageViewOrder) {
};
```
![Image](./Screens/JMImageViewCarousel.png "Screenshot")
![Image](./Screens/JMimageViewCarousel.gif "Carousel Demo")
![Image](./Screens/JMImageViewRotation.gif "Rotation Demo")
Expand Down

0 comments on commit e7dd619

Please sign in to comment.