Hello,
At RunTime I'm being suggested an Optimization Opportunity for some code I've written.
The layer is using a simple layer with background color set as a mask. Instead, use a container layer of the same "frame" and "cornerRadius" as the mask, but with "masksToBounds" set to YES
I'm afraid I don't know what is meant here by a "container layer". This is the code that threw up the optimization opportunity
let maskView = UIView(frame: CGRect(x: 0, y: 0, width: 45, height: 90))
maskView.backgroundColor = .black
filledImage.mask = maskView
The code above masks half of a 90x90 UIImageView
filledImage
. Any ideas how this could be refactoring to use a "container layer".
Many thanks