General Objective-C snippets to work around some iOS issues.
This file contains 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
// Drawing a dotted line | |
float width = kBoundsWidth - 90; | |
CAShapeLayer *shapelayer = [CAShapeLayer layer]; | |
UIBezierPath *path = [UIBezierPath bezierPath]; | |
[path moveToPoint:CGPointMake(-30, 30)]; | |
[path addLineToPoint:CGPointMake(width, 30)]; | |
UIColor *fill = [UIColor lightGrayColor]; | |
shapelayer.strokeStart = 0.0; | |
shapelayer.strokeColor = fill.CGColor; | |
shapelayer.lineWidth = 0.5; | |
shapelayer.lineJoin = kCALineJoinRound; | |
shapelayer.lineDashPattern = [NSArray arrayWithObjects:[NSNumber numberWithInt:1],[NSNumber numberWithInt:3 ], nil]; | |
shapelayer.path = path.CGPath; | |
[self.cardNumber.layer addSublayer:shapelayer]; | |
// Fliping image position inside UIButton | |
self.browseByDepartmentButton.transform = CGAffineTransformMakeScale(-1.0, 1.0); | |
self.browseByDepartmentButton.titleLabel.transform = CGAffineTransformMakeScale(-1.0, 1.0); | |
self.browseByDepartmentButton.imageView.transform = CGAffineTransformMakeScale(-1.0, 1.0); | |
// To change opaque modal views status bar | |
[[self navigationController] presentViewController:detailEditView animated:YES completion:^{ | |
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault]; | |
}]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment