Browse Source

VLCPlaylistTableViewCell: set the selectedBackgroundColor to clear and remove unused class method

Carola Nitz 7 years ago
parent
commit
3096f0e3c1
2 changed files with 7 additions and 13 deletions
  1. 0 1
      Sources/VLCPlaylistTableViewCell.h
  2. 7 12
      Sources/VLCPlaylistTableViewCell.m

+ 0 - 1
Sources/VLCPlaylistTableViewCell.h

@@ -29,7 +29,6 @@ static NSString *kPlaylistCellIdentifier = @"PlaylistCell";
 
 @property (nonatomic, strong) NSManagedObject *mediaObject;
 
-+ (VLCPlaylistTableViewCell *)cellWithReuseIdentifier:(NSString *)ident;
 + (CGFloat)heightOfCell;
 
 - (void)collapsWithAnimation:(BOOL)animate;

+ 7 - 12
Sources/VLCPlaylistTableViewCell.m

@@ -26,22 +26,17 @@
 
 @implementation VLCPlaylistTableViewCell
 
-- (void)dealloc
+- (void)awakeFromNib
 {
-    [self _removeObserver];
+    [super awakeFromNib];
+    UIView *bgColorView = [[UIView alloc] init];
+    bgColorView.backgroundColor = [UIColor clearColor];
+    [self setSelectedBackgroundView:bgColorView];
 }
 
-+ (VLCPlaylistTableViewCell *)cellWithReuseIdentifier:(NSString *)ident
+- (void)dealloc
 {
-    NSArray *nibContentArray;
-    nibContentArray = [[NSBundle mainBundle] loadNibNamed:@"VLCPlaylistTableViewCell" owner:nil options:nil];
-    NSAssert([nibContentArray count] == 1, @"meh");
-    NSAssert([[nibContentArray lastObject] isKindOfClass:[VLCPlaylistTableViewCell class]], @"meh meh");
-    VLCPlaylistTableViewCell *cell = (VLCPlaylistTableViewCell *)[nibContentArray lastObject];
-    cell.multipleSelectionBackgroundView = [[UIView alloc] initWithFrame:cell.frame];
-    cell.metaDataLabel.hidden = YES;
-
-    return cell;
+    [self _removeObserver];
 }
 
 - (void)prepareForReuse