I have a UIView, and I want to make multiple replicas of it that I can position on different points of the screen. I also want to be able to apply different masks/transforms to each of the replicas so that each one can potentially show a different portion of the original.
For example, let's say that that I have a view, A
, and I make two replicas of it, B
, and C
. I want to then apply a mask to B
so that it only shows the top half of A
and I want to apply a different mask to C
so that it only shows the bottom half of A
.
How would I go about doing this?
CAReplicatorLayer isn't really usable for what I'm trying to do in my application as the replicas need to be in different parts of the view hierarchy. Also, I can't use any method that makes use of snapshotting as the original view may contain animated content or video. What I really want is some sort of view that can mirror the contents of another view so that I have two views that look exactly the same.