iOS : How to display text in different angles or upside down?

Imagine you are building a playing card game where you need to display the face value of the card upside down.

Here is how to do it programatically.

quick dirty example.

When you run this code you will see this.

#define degreesToRadians(x) (M_PI * x / 180.0)

then you can rotate a view like this:

view.transform = 
CGAffineTransformMakeRotation( degreesToRadians(45));
//rotate the view 45 degrees


Here are some examples.








You can do rotating(CGAffineTransformRotation), scaling(CGAffineTransformScale), moving(CGAffineTransformTranslate), etc of the view.

Read here for detailed explanation.

Email me when Kishore Kumar Mohan publishes or recommends stories