The wonders of refactoring

As I’ve purged and rewritten  a lot of code recently, I am revisiting things that I implemented in 2009 and then never really looked at again — why fix something that is working?  Cell sizing in a table view used to be a real pain an involved a decent amount of code that calculated the size of various cells using the size of a string for a particular font. Worse still, these string calculations had to be done on the main thread because they used UI elements to compute their size.  It was a lot of code that was replaced entirely by auto layout and  the UITableView’s automatic dimension.  The end product is conversation cells that look a lot more like iMessage: