Skip to content
Sequence Animation to POP Framework. Runs POP Animations sequentially, one after another.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
JPPopSequenceAnimation.xcodeproj
JPPopSequenceAnimation.xcworkspace
JPPopSequenceAnimation
JPPopSequenceAnimationTests
Pods
.gitignore
JPPopSequenceAnimation.podspec
LICENSE
Podfile
Podfile.lock
README.md

README.md

JPPopSequenceAnimation

Runs POP Animations sequentially, one after another.

Installation

Cocoapods

Edit Podfile and add JPPopSequenceAnimation:

pod 'JPPopSequenceAnimation'

Manual

Clone the repository:

$ git clone https://github.com/Juanpe/JPPopSequenceAnimation.git

Drag and drop JPPopSequenceAnimationClasses folder into your project. Add #import "JPPopSequenceAnimation.h" to all view controllers that need to use it.

Requirements

  • iOS 7.0 or higher
  • ARC

Parameters

You can easily set the number of repetitions of sequence and set start index:

@property (nonatomic) NSInteger beginIndex;
@property (nonatomic) NSInteger numRepeats;

sequenceAnimation.numRepeats = 2;
sequenceAnimation.numRepeats = JPPopSequenceRepeatForever; // Forever

sequenceAnimation.beginIndex = 1;

If you want to get animations callbacks, you must implement protocol named ```JPPopSequenceAnimationDelegate```.
@optional
- (void) sequenceDidStart:(JPPopSequenceAnimation *) sequence;
- (void) sequenceDidResume:(JPPopSequenceAnimation *) sequence;
- (void) sequenceDidStop:(JPPopSequenceAnimation *) sequence;
- (void) sequenceDidPause:(JPPopSequenceAnimation *) sequence;
- (void) sequenceDidNextAnimation:(JPPopSequenceAnimation *) sequence
                          atIndex:(NSInteger) index;


- (void) sequence:(JPPopSequenceAnimation *) sequence
animationDidStart:(POPAnimation *) anim
          atIndex:(NSInteger) index;

- (void) sequence:(JPPopSequenceAnimation *) sequence
 animationDidStop:(POPAnimation *) anim
          atIndex:(NSInteger) index
         finished:(BOOL) finished;

Sample Usage

POPBasicAnimation *anim = [POPBasicAnimation animationWithPropertyNamed:kPOPViewAlpha];
anim.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
anim.fromValue = @(1.0);
anim.toValue = @(0.0);
anim.name = @"fadeOut";

POPBasicAnimation *anim1 = [POPBasicAnimation animationWithPropertyNamed:kPOPViewAlpha];
anim1.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
anim1.fromValue = @(0.0);
anim1.toValue = @(1.0);
anim.name = @"fadeIn";

JPPopSequenceAnimation * sequenceAnimation = [[JPPopSequenceAnimation alloc] initWithAnimations:@[anim, anim1]];

sequenceAnimation.delegate = self;

[self.squareView addSequenceAnimation:sequenceAnimation
                               forKey:@"sequence_1"];
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.