wickwirew / Shift

Shift is a simple, declarative animation library for building complex view controller and view transitions in UIKit.
MIT License
213 stars 14 forks source link

Why do we use this block code? #4

Closed BayramInanc closed 1 year ago

BayramInanc commented 1 year ago

Screenshot 2023-04-09 at 22 43 51

5df9.png">

when we creating snapshot of UIView, why do we check if it is a imageview or not, is it neccassary? I did not understand, and can it make performance slower, I suspect that. Thanks for your effort.

wickwirew commented 1 year ago

Its so they resize better. A normal snapshot just copies the rendered bitmap into a new UIView and is not a clone of the view. So if an image is upsized/scaled the image resolution can get weird and not look great

BayramInanc commented 1 year ago

Thank you, got it