Skip to content

Instantly share code, notes, and snippets.

@tLewisII
Created March 16, 2014 00:06
Show Gist options
  • Save tLewisII/9575998 to your computer and use it in GitHub Desktop.
Save tLewisII/9575998 to your computer and use it in GitHub Desktop.
Rotating UIProgressView
- (void)showVerticallyOnLeftSideOfView:(UIView *)parent havingNavigationBar:(BOOL)havingNavBar {
[parent addSubview:self];
CGFloat widthOffset = havingNavBar ? 64 : 0;
CGFloat x = CGRectGetWidth(parent.bounds) - (CGRectGetHeight(parent.bounds));
self.frame = (CGRect){
.origin.x = x,
.origin.y = CGRectGetMaxY(parent.bounds),
.size.width = CGRectGetHeight(parent.bounds) - widthOffset,
.size.height = 0
};
self.layer.anchorPoint = CGPointMake(0.0f, 1.0f);
self.transform = CGAffineTransformMakeRotation((CGFloat)tjl_degToRadians(-90));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment