From 2db33ea12fcfa87654ecf0ba54db21786f1fe821 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 10 Mar 2017 21:46:41 -0800 Subject: Transfer shared content code to CyteTableViewCell. --- CyteKit/TableViewCell.mm | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'CyteKit') diff --git a/CyteKit/TableViewCell.mm b/CyteKit/TableViewCell.mm index 827440b..1b9152e 100644 --- a/CyteKit/TableViewCell.mm +++ b/CyteKit/TableViewCell.mm @@ -56,6 +56,19 @@ bool highlighted_; } +- (instancetype) initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier { + if ((self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) != nil) { + UIView *content([self contentView]); + CGRect bounds([content bounds]); + + self.content = [[[CyteTableViewCellContentView alloc] initWithFrame:bounds] autorelease]; + [self.content setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [content addSubview:self.content]; + + [self.content setDelegate:(id)self]; + } return self; +} + - (void) _updateHighlightColorsForView:(UIView *)view highlighted:(BOOL)highlighted { if (view == (UIView *) content_) highlighted_ = highlighted; -- cgit v1.2.3