I have a UIImageView
called zigZag
. All I want to do is set a layer mask on it so that it is not visible at all.
I then want to animate the layer mask later so that the UIImageView
becomes visible again.
I have been working on this for 4 hours now and can't seem to figure out what the heck I'm doing wrong.
// Setup the mask layer
// Make it the same size as our zigZag image
// so that the entire image is covered and not visible
let maskLayer = CALayer()
maskLayer.frame = self.zigZag!.frame
self.zigZag!.layer.mask = maskLayer
This works, and the zigZag
UIImageView
is not visible on screen, but here's the thing. I can literally pass in any value I want to maskLayer.frame
and it will still be hidden.
This leads me to believe that I am doing something fundamentally wrong when thinking about creating my mask layers. There is a lot more to this problem I am trying to achieve, but I figured the first step was figuring out how to properly set a mask layer to hide an entire UIImageView
to make it appear as if it is not even on screen.
Thanks for the help I greatly appreciate it.