The Hit List Diary #11.1 – More Right Detail Table Cells

Earlier I looked at layout problems with right-detail table cells introduced in iOS 8. Doing some more work around this, I realised there’s another issue worth mentioning:

When working with such a cell, UITableViewCell simply throws the raw underlying UILabel at us and allows whatever configuration we see fit. Normally this is as simple as sticking in our desired string. Maybe there’ll be some configuration of font/colour etc. in IB beforehand too.

The trouble is when setting the label’s text, that doesn’t seem to let the cell know that it might now need to re-layout its content to accommodate the new text. In theory autolayout makes these things nice to automate. But as best I can tell, cells aren’t using that for their detail text, at least not in the setup we have.

So it seems that we’re forced to trigger layout ourselves each time like so:

Can’t say I like it, but there we go.

© Mike Abdullah 2007-2015