alikaragoz / MCSwipeTableViewCell

:point_up_2: Convenient UITableViewCell subclass that implements a swippable content to trigger actions (similar to the Mailbox app).
MIT License
2.96k stars 412 forks source link

isBackgroundClear behavior #64

Closed brunnoferreira closed 10 years ago

brunnoferreira commented 10 years ago

Is there any performance (or other) reason why this piece of code:

BOOL isContentViewBackgroundClear = !self.contentView.backgroundColor;
    if (isContentViewBackgroundClear) {
        BOOL isBackgroundClear = [self.backgroundColor isEqual:[UIColor clearColor]];
        self.contentView.backgroundColor = isBackgroundClear ? [UIColor whiteColor] :self.backgroundColor;
    }

assigns [UIColor whiteColor] instead of [UIColor clearColor] to self.contentView.backgroundColor?

A current project of mine uses transparent contentViews and UIImageViews on the background, so coloring the cell ends up breaking the UI.

If there are no known issues with using clearColor, may I suggest this modification?

thorst commented 10 years ago

Did you have issues when you made the change? Mine was set to clear and I saw that basically there was a copy of the cell, so when you drug it to the side you would see the text 2 times. Setting it to white hid the duplicate.

brunnoferreira commented 10 years ago

Hey @thorst, sorry for taking so long to reply.

I did not have any issues when making the proposed changes. Everything works quite fine setting the backgroundColor property to clearColor. Though I must mention that the cells on this project of mine use UIImageViews on the background, so that's probably why I wasn't seeing any duplicates like you did.

Setting the backgroundColor property to whiteColor didn't work for me because it would also hide those images, so I guess the better solution really depends on some project specific configurations.

I guess I didn't realize that before when asking this question, so I'll go ahead and close this issue.

Thanks for taking your time to reply!