在Objective-C中實現易讀鏈式動畫寫法:JHChainableAnimations

jopen 10年前發布 | 22K 次閱讀 iOS開發 移動開發 JHChainableAnimations

JHChainableAnimations讓你能夠在Objective-C中實現易讀鏈式動畫寫法。

在Objective-C中實現易讀鏈式動畫寫法:JHChainableAnimations

</tr>

</tr> </tbody> </table>

老的寫法

    [UIView animateWithDuration:1.0 delay:0.0 usingSpringWithDamping:0.8 initialSpringVelocity:1.0 options:0 animations:^{ CGPoint newPosition = self.myView.frame.origin;
                            newPosition.x += 50;
                            self.myView.frame.origin = newPosition;
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^{
            self.myView.backgroundColor = [UIColor purpleColor];
        } completion:nil];
    }];
</h3>

利用JHChainableAnimations只要一行代碼就能搞定

新的寫法(JHChainableAnimations!!!)

self.myView.moveX(50).spring.thenAfter(1.0).makeBackground([UIColor purpleColor]).easeIn.animate(0.5);

項目主頁:http://www.baiduhome.net/lib/view/home/1431672536388

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!
在Objective-C中實現易讀鏈式動畫寫法:JHChainableAnimations
 在Objective-C中實現易讀鏈式動畫寫法:JHChainableAnimations
  • sesese色