Which is more efficient from a performance perspective: adding a shadow to a view with the shadow path or putting a shadow in the png for the background of the view? The view will be animating around the screen but not changing size.
Which is more efficient from a performance perspective: adding a shadow to a view
Share
Putting a shadow in the PNG will always be more efficient because that is one less thing to calculate. However, if you set your view’s layer to rasterize (
view.layer.shouldRasterize) then it will only recalculated when its size changes so the difference won’t be big.