not good but great

プログラミング、アート、映画・本の感想について書きます。

CADisplayLinkとかanimateWithDurationらへんでアニメーションさせるコード読んだ

qiita.com
こちらの記事を書いた。

https://raw.githubusercontent.com/fastred/BouncyView/master/demo.gif

GitHub - fastred/BouncyView: Action Sheet animation based on Skype's iOS app.
Skypeのアニメーションのクローンらしい。
Recreating Skype's Action Sheet Animation – Arek Holko
こちらの記事を読んでいると、自分の書いたQiita記事がベストなやり方かわからんなくなってきたw

こちらはCADisplayLinkをタイマーにして、animateWithDurationでバネの動きを再現している。こちらのほうが正確にバネの位置を計算しているし、細かい時間で位置を設定しているので動きが滑らかである。


このへんを読んでみた。animationを通して、iOSの理解が深まるような気がしたw
drawrectとsetneedsdisplayとlayerの描画の図解まとめ
http://blog.f60k.com/drawrect_setneedsdisplay_layer/