Created
October 6, 2013 23:58
-
-
Save soffes/6860677 to your computer and use it in GitHub Desktop.
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
// | |
// SHRZebraView.h | |
// Shares | |
// | |
// Created by Sam Soffes on 9/19/13. | |
// Copyright (c) 2013 Nothing Magical. All rights reserved. | |
// | |
@interface SHRZebraView : UIView | |
@end |
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
// | |
// SHRZebraView.m | |
// Shares | |
// | |
// Created by Sam Soffes on 9/19/13. | |
// Copyright (c) 2013 Nothing Magical. All rights reserved. | |
// | |
#import "SHRZebraView.h" | |
#import "SHStockTableViewCell.h" | |
#import "UIColor+Shares.h" | |
@implementation SHRZebraView | |
- (instancetype)initWithFrame:(CGRect)frame { | |
if ((self = [super initWithFrame:frame])) { | |
self.backgroundColor = [UIColor shr_lightRowColor]; | |
} | |
return self; | |
} | |
- (void)drawRect:(CGRect)rect { | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
[[UIColor shr_darkRowColor] setFill]; | |
CGSize size = self.bounds.size; | |
CGFloat rowHeight = [SHStockTableViewCell cellHeight]; | |
for (CGFloat i = rowHeight; i < size.height; i += rowHeight * 2.0f) { | |
CGContextFillRect(context, CGRectMake(0.0f, i, size.width, rowHeight)); | |
} | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment