GkNx GkNx - 1 year ago 125
iOS Question

how can i flip a label (get the mirror view) in swift (Xcode 6.3)

I am trying to flip (get the mirror view) a label text with CGAffineTransformMakeRotation. But still no progress.

this code flips it vertically but i could not flip it horizontally.

self.labelShowdata.transform = CGAffineTransformMakeRotation((180.0 * CGFloat(M_PI)) / 180.0)


Answer Source

Try this:

self.labelShowdata.transform = CGAffineTransformMakeScale(-1, 1);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download