- drag the directory
AddCoinView
into your project. - add header
#import "AddCoinAnimationManager.h"
- use these code
@property (nonatomic, strong) AddCoinAnimationManager *addCoinAnimationManager;
- (AddCoinAnimationManager *)addCoinAnimationManager {
if(!_addCoinAnimationManager) {
_addCoinAnimationManager = [[AddCoinAnimationManager alloc] init];
_addCoinAnimationManager.snapRect = CGRectMake(300, 0, 20, 20);
_addCoinAnimationManager.displayRect = CGRectMake(0, 0, 300, 300);
_addCoinAnimationManager.maxDisplayAmount = 20;
_addCoinAnimationManager.delegate = self;
_addCoinAnimationManager.associatedView = self.view;
}
return _addCoinAnimationManager;
}
- produce coins:
[self.addCoinAnimationManager addCoins:10;
- gather coins to a point and dismiss
[self.addCoinAnimationManager popCoins:10];
- Or, you just want to remove them
[self.addCoinAnimationManager removeCoins:10];
- hide or show all the coins
[self.addCoinAnimationManager setCoinsHide:YES];
- Force to stop and remove all the coins
[self.addCoinAnimationManager stop];
PS. Just download project and run the demo within.