Last active
August 29, 2015 14:23
-
-
Save paulw11/b6eef396b5abe3e10ed3 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
#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