Skip to content

Instantly share code, notes, and snippets.

@kkodev
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkodev/9512005 to your computer and use it in GitHub Desktop.
Save kkodev/9512005 to your computer and use it in GitHub Desktop.
if (!self.lineLayer.superlayer)
[self.layer addSublayer:self.lineLayer];
CGFloat height = 1.0f / [UIScreen mainScreen].scale;
self.lineLayer.frame = CGRectMake(0.0, CGRectGetHeight(self.bounds) - height, CGRectGetWidth(self.bounds), height);
#pragma mark - Lazy loading
- (CALayer *)lineLayer {
if (!self->_lineLayer) {
CALayer *lineLayer = [[CALayer alloc] init];
lineLayer.backgroundColor = [UIColor colorWithWhite:0.8f alpha:1.0f].CGColor;
self->_lineLayer = lineLayer;
}
return self->_lineLayer;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment