In my iPhone App, I want to programatically rotate the view by 180 degrees.
Is that possible, if yes how?
Should be possible by using CGAffineTransform
Quote from this question, this should do the trick:
CGFloat radians = atan2f(yourView.transform.b, yourView.transform.a); CGFloat degrees = radians * (180 / M_PI); CGAffineTransform transform = CGAffineTransformMakeRotation((90 + degrees) * M_PI/180); yourView.transform = transform;