Skip to content

Instantly share code, notes, and snippets.

@paulw11
Last active August 29, 2015 14:23
Show Gist options
  • Save paulw11/b6eef396b5abe3e10ed3 to your computer and use it in GitHub Desktop.
Save paulw11/b6eef396b5abe3e10ed3 to your computer and use it in GitHub Desktop.
#import "QuoteTableViewCell.h"
@implementation QuoteTableViewCell
- (void)setBounds:(CGRect)bounds
{
[super setBounds:bounds];
self.contentView.frame = self.bounds;
}
- (void)setUpView{
self.numberLabel.text = [NSString stringWithFormat:@"Quote is number %ld", [self.cellData[@"rowNumber"] integerValue]];
[self.controlSwitch setOn:[self.cellData[@"checked"] boolValue]];
if([self.controlSwitch isOn]){
self.quoteLabel.hidden=NO;
self.quoteLabel.text = self.cellData[@"quote"];
self.bottomConst.constant=10;
}else{
self.quoteLabel.hidden=YES;
self.quoteLabel.text=@"";
self.bottomConst.constant=0;
}
[self layoutIfNeeded];
}
- (void)layoutSubviews
{
[super layoutSubviews];
self.selectionStyle = UITableViewCellSelectionStyleNone;
[self.contentView layoutIfNeeded];
}
- (IBAction)removeQuote:(id)sender {
[self.delegate updateCell:self];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment