Skip to content

Commit

Permalink
Fixing issue vicpenap#34
Browse files Browse the repository at this point in the history
Fixed support for cell instantiation from storyboard.
  • Loading branch information
alexandreos committed Aug 16, 2013
1 parent fb2531e commit ca5aea8
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions PrettyKit/Cells/PrettyTableViewCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,30 @@ - (void)initializeVars
self.customSeparatorStyle = UITableViewCellSeparatorStyleSingleLine;
}

- (id)initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self)
{
[self.contentView addObserver:self forKeyPath:@"frame" options:NSKeyValueObservingOptionOld context:nil];

PrettyTableViewCellBackground *bg = [[PrettyTableViewCellBackground alloc] initWithFrame:self.frame
behavior:CellBackgroundBehaviorNormal];
bg.cell = self;
self.backgroundView = bg;
[bg release];

bg = [[PrettyTableViewCellBackground alloc] initWithFrame:self.frame
behavior:CellBackgroundBehaviorSelected];
bg.cell = self;
self.selectedBackgroundView = bg;
[bg release];

[self initializeVars];
}
return self;
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
Expand Down

0 comments on commit ca5aea8

Please sign in to comment.