UITableView I have a custom UItableViewCell . This custom cell has a preview (subclass of UIView). I use the drawRect custom UIView subclass to place all the text that the cell will display.
And in drawRect (subclass of UIView ) I do the following
- (void)drawRect:(CGRect)rect { self.layer.cornerRadius = 10.0f; self.layer.backgroundColor = [[UIColor orangeColor] CGColor]; self.layer.borderColor = [[UIColor lightGrayColor] CGColor]; self.layer.borderWidth = 3.0f; }
However, my custom cell is a black square like this

But I see intentional behavior if I select a row. As below

What's happening?
source share