Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A simple category that allows one to easily set/get UIView rotation.
// UIView+Additions.h
// Created by Shilo White on 10/8/11.
// Copyright 2011 Shilocity Productions. All rights reserved.
#import <Foundation/Foundation.h>
@interface UIView (Additions)
@property (nonatomic, assign) float rotation;
@implementation UIView (Additions)
- (void)setRotation:(float)rotation {
self.transform = CGAffineTransformMakeRotation(rotation);
- (float)rotation {
return atan2f(self.transform.b, self.transform.a);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment