1 Reply
      Latest reply on Mar 17, 2019 3:25 PM by Claude31
      flarosa Level 1 Level 1 (0 points)

        I know I can access self.frame within a UITableViewCell to figure out its height, but I can only do that whenever something else calls a function on the cell. What if the height changes at some other time?

         

        What I want to do is display a circular view within the cell. The only way I know to do this is to set the view layer's cornerRadius property to half the height of the view, and to do that I need to know the height. And if the height changes, I need to update the radius. It would be great if there was a way to express this as a constraint, but if there is I don't know about it.

         

        So I could do this at awakeFromNib or prepareForReuse, and that might work fine in most cases, but is there a general way I can get notified when the cell's height changes? Ideally I'd want to do this totally within the cell and not depend on the data source or delegate to manage it.

         

        Frank