Created
May 28, 2013 12:45
-
-
Save randomsequence/5662517 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
@interface ChildSelectedCell : UITableViewCell | |
@property (nonatomic) BOOL childSelected; | |
@end | |
@implementation ChildSelectedCell | |
- (void)setChildSelected:(BOOL)childSelected { | |
if (childSelected == _childSelected) return; | |
_childSelected = childSelected; | |
if (childSelected) { | |
UIView *backgroundView = [[UIView alloc] initWithFrame:self.bounds]; | |
backgroundView.backgroundColor = [UIColor blueColor]; | |
self.backgroundView = backgroundView; | |
} else { | |
self.backgroundView = nil; | |
} | |
} | |
- (void)prepareForReuse { | |
[super prepareForReuse]; | |
self.childSelected = NO; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment