Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)

Thanks

like image 917
GkNx Avatar asked Apr 21 '15 21:04

GkNx


1 Answers

Try this:

self.labelShowdata.transform = CGAffineTransformMakeScale(-1, 1);

Swift 5:

self.table.transform = CGAffineTransform(scaleX: -1, y: 1);
like image 105
Choppin Broccoli Avatar answered Oct 16 '22 13:10

Choppin Broccoli