
聽說貼上一個(gè)圖是規(guī)矩
POP: 一個(gè)流行的可擴(kuò)展的動(dòng)畫引擎iOS,它支持spring和衰變動(dòng)態(tài)動(dòng)畫,使其可用于構(gòu)建現(xiàn)實(shí),基于物理交互。Objective - C API允許快速集成, 對(duì)于所有的動(dòng)畫和過渡他是成熟的.
解釋:
1.1 POP 使用 Objective-C++ 編寫,Objective-C++ 是對(duì) C++ 的擴(kuò)展,就像 Objective-C 是 C 的擴(kuò)展。而至于為什么他們用 Objective-C++ 而不是純粹的 Objective-C. 可能是偏愛。-.O
1.2 POP 目前由四部分組成:1. Animations;2. Engine;3. Utility;4. WebCore。下圖有助于你更好的理解它的架構(gòu)

構(gòu)成
- 它支持CocoaPods 你可以這樣
pod 'pop', '~> 1.0.8'
或者這樣點(diǎn)擊下載拉入工程
我使用的Cocoapods 所以使用之前你需要這樣
#import <POP.h>

XT_01
E1:
- (void)clickPopAction
{
// kPOPLayerPositionY 向下
// kPOPLayerPositionX 向右
POPSpringAnimation *anim = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerPositionY];
// 移動(dòng)距離
anim.toValue = [[NSNumber alloc] initWithFloat:_btnPop.center.y + 200];
// 從當(dāng)前 + 1s后開始
anim.beginTime = CACurrentMediaTime() + 1.0f;
// 彈力--晃動(dòng)的幅度 (springSpeed速度)
anim.springBounciness = 15.0f;
[_btnPop pop_addAnimation:anim forKey:@"position"];
POPSpringAnimation *anim1 = [POPSpringAnimation animationWithPropertyNamed:kPOPLayerBounds];
anim1.toValue = [NSValue valueWithCGRect:CGRectMake(100, 100, 99, 99)];
[_btnPop pop_addAnimation:anim1 forKey:@"size"];
}

XT_02
E2:在很多金融類app中比較常見、支付寶中的余額包、京東金融余額、就類似這樣
// 初始化
POPBasicAnimation *anim = [POPBasicAnimation animation];
// 限時(shí) 1s. 2s.
anim.duration = 3.0;
POPAnimatableProperty * prop = [POPAnimatableProperty propertyWithName:@"count++" initializer:^(POPMutableAnimatableProperty *prop) {
prop.readBlock = ^(id obj, CGFloat values[]){ values[0] = [[obj description] floatValue]; };
prop.writeBlock = ^(id obj, const CGFloat values[])
{
[obj setText:[NSString stringWithFormat:@"%.2f",values[0]]];
};
prop.threshold = 0.01;
}];
anim.property = prop;
anim.fromValue = @(0.0);
anim.toValue = @(1314.52);
[self.xt_countLabel pop_addAnimation:anim forKey:@"counting"];

XT_03
E3
CALayer *layer0 = [CALayer layer];
layer0.opacity = 1.0;
layer0.transform = CATransform3DIdentity;
[layer0 setMasksToBounds:YES];
[layer0 setBackgroundColor:[UIColor colorWithRed:0.5448 green:0.6836 blue:0.9986 alpha:1.0].CGColor];
[layer0 setCornerRadius:12.5];
[layer0 setBounds:CGRectMake(0, 0, 25, 25)];
[self.view.layer addSublayer:layer0];
layer0.position = CGPointMake(self.view.center.x, 266);
[self performAnimation:layer0];
- (void)performAnimation:(CALayer *)layer
{
[layer pop_removeAllAnimations];
POPBasicAnimation *anim = [POPBasicAnimation animationWithPropertyNamed:kPOPLayerScaleXY];
static BOOL ani = YES;
if (ani) {
anim.toValue = [NSValue valueWithCGPoint:CGPointMake(1.0, 1.0)];
}else{
anim.toValue = [NSValue valueWithCGPoint:CGPointMake(1.5, 1.5)];
}
ani = !ani;
anim.completionBlock = ^(POPAnimation *anim, BOOL finished) {
if (finished) { [self performAnimation:layer]; }
};
[layer pop_addAnimation:anim forKey:@"Animation"];
}
Swift版本仿網(wǎng)易云音樂播放音樂動(dòng)畫效果-- 簡(jiǎn)書
三分鐘教你把代碼托管到Github -- 簡(jiǎn)書
Swift 很強(qiáng)大的圖表庫(kù)-Charts使用 -- 簡(jiǎn)書
Swift版仿簡(jiǎn)書App淘寶App很友好彈出view效果 -- 簡(jiǎn)書
iOS UICollectionView高級(jí)用法“長(zhǎng)按自由移動(dòng)cell重排 -- 簡(jiǎn)書
iOS仿微信App添加帶箭頭的view -- 簡(jiǎn)書
iOS仿美團(tuán)外賣餓了嗎App點(diǎn)餐動(dòng)畫 -- 簡(jiǎn)書
你要的Swift資料 -- 簡(jiǎn)書