Want to understand exact difference between masking any layer and adding a layer as sublayer. I have searched and found some answers but not able to understand it correctly.
Something I found like masking causes offscreen rendering but adding a sublayer doesn't so can't we just use addsublayer?
Here I found something but not getting this so if there is any example of this would help more
More specific : Lets have a layer say layer1
now I want to understand difference between following :
addSublayer(layer1)
mask = layer1
We know here that both are applied using main layer of our UIView
like view.layer