-
Notifications
You must be signed in to change notification settings - Fork 150
Closed
Description
Hi, looks like your awesome toolkit does not work out of the box with UIStoryboard created cells (and I doubt it will work with NIBs anyway because of missing awakeFromNIB). Therefore I wrote a little workaround that seems to fix the problem:
- (void)configureCell {
if(_configured) {
return;
}
_configured = YES;
[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];
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self configureCell];
}
return self;
}
I added the call here too:
- (void) prepareForTableView:(UITableView *)tableView indexPath:(NSIndexPath *)indexPath
{
[self configureCell];
_tableViewStyle = tableView.style;
self.position = [PrettyTableViewCell positionForTableView:tableView indexPath:indexPath];
}
Hope this is somehow usefull.
Cheers,
Dirk
Metadata
Metadata
Assignees
Labels
No labels