Last active
December 18, 2015 15:19
-
-
Save xandrucea/5803881 to your computer and use it in GitHub Desktop.
UIView Snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int count = 0; | |
| for(UIView *v in [actualView subviews]){ | |
| if([v isMemberOfClass:[UIView class]]){ | |
| NSLog(@"Aktual View %d: %@", count, v); | |
| count++; | |
| } | |
| } | |
| - (void)printMyFrame:(CGRect)aFrame{ | |
| static int view = 0; | |
| NSLog(@"FRAME %d: %f, %f, %f, %f", | |
| view, aFrame.origin.x, aFrame.origin.y, aFrame.size.width, aFrame.size.height); | |
| view++; | |
| } | |
| -(void)myLabel:(UILabel *)aLabel withFontSize:(float)aSize{ | |
| font = [UIFont fontWithName:GROBOLDpro size:aSize]; | |
| aLabel.font = font; | |
| if(screenSize.height > 480.0f){ | |
| [self setShadowForLabel:aLabel]; | |
| } | |
| } | |
| -(void)setShadowForButton:(UIButton *)aButton{ | |
| aButton.imageView.layer.cornerRadius = 3.0f; | |
| aButton.layer.shadowRadius = 1.0f; | |
| aButton.layer.shadowColor = [UIColor blackColor].CGColor; | |
| aButton.layer.shadowOffset = CGSizeMake(1.5f, 1.5f); | |
| aButton.layer.shadowOpacity = 0.9f; | |
| aButton.layer.masksToBounds = NO; | |
| } | |
| - (void)transformScale{ | |
| [_viewChat setTransform:CGAffineTransformMakeScale(viewX, viewY)]; | |
| // view anchorPoint is initial in the middle of a view | |
| _viewChat.layer.anchorPoint = CGPointMake(0.5f, 0.0f); | |
| [UIView animateWithDuration:fadeOut animations:^{ | |
| _viewChat.frame = CGRectMake(frameX, frameY, frameWidth, 0.0f); | |
| _viewChat.transform = CGAffineTransformScale(CGAffineTransformMakeTranslation(1.0f, 0.0f), viewX, 0.0); | |
| } completion:nil]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment