Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added `cellViewFrame` to allow for customization of how the cell's vi…

…ew is drawn
  • Loading branch information...
commit 43a21a1a897a6374601df32c67686b90be0841bc 1 parent 7aad472
@soffes soffes authored
Showing with 8 additions and 3 deletions.
  1. +1 −0  SSTableViewCell.h
  2. +7 −3 SSTableViewCell.m
View
1  SSTableViewCell.h
@@ -18,5 +18,6 @@
@property (nonatomic, retain, readonly) UIView *cellView;
- (void)drawContentView:(CGRect)rect;
+- (CGRect)cellViewFrame;
@end
View
10 SSTableViewCell.m
@@ -53,9 +53,7 @@ - (void)setNeedsDisplay {
- (void)setFrame:(CGRect)frame {
[super setFrame:frame];
-
- CGSize size = self.contentView.frame.size;
- _cellView.frame = CGRectMake(0.0f, 1.0f, size.width, size.height - 2.0f);
+ _cellView.frame = [self cellViewFrame];
[self setNeedsDisplay];
}
@@ -83,4 +81,10 @@ - (void)drawContentView:(CGRect)rect {
// Subclasses should implement this
}
+
+- (CGRect)cellViewFrame {
+ CGSize size = self.contentView.frame.size;
+ return CGRectMake(0.0f, 1.0f, size.width, size.height - 2.0f);
+}
+
@end
Please sign in to comment.
Something went wrong with that request. Please try again.