FabrizioCaldarelli
6/19/2015 - 7:50 PM

UITableViewCell full width

UITableViewCell full width

#import "FullWidthTableViewCell.h"

@implementation FullWidthTableViewCell

- (void)awakeFromNib {
    // Initialization code
    
    // Remove seperator inset
    if ([self respondsToSelector:@selector(setSeparatorInset:)]) {
        [self setSeparatorInset:UIEdgeInsetsZero];
    }
    
    // Prevent the cell from inheriting the Table View's margin settings
    if ([self respondsToSelector:@selector(setPreservesSuperviewLayoutMargins:)]) {
        [self setPreservesSuperviewLayoutMargins:NO];
    }
    
    
    // Explictly set your cell's layout margins
    if ([self respondsToSelector:@selector(setLayoutMargins:)]) {
        [self setLayoutMargins:UIEdgeInsetsZero];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
#import <UIKit/UIKit.h>

@interface FullWidthTableViewCell : UITableViewCell

@end