I would like to know if it is possible to flip the contents of a UIView
within the same device; meaning not to an external monitor but on the device itself.
I have searched a bit on google, but all I can find is to external screens.
I would like to know if it is possible to flip the contents of a UIView
within the same device; meaning not to an external monitor but on the device itself.
I have searched a bit on google, but all I can find is to external screens.
CGAffineTransform
is your friend here. Here's some simplified sample code taken form an Xcode Template UIViewController to add a UILabel to a it's view and have that view mirrored. The mirroring is just a side affect of a negative scale. You can do all sorts of things withCGAffineTransform
methods, not just limited to scale.You can use CGAffineTransformMakeScale with negative values. Like:
This can be applied on the view by:
or