scheinem/MSCMoreOptionTableViewCell — pull request #23 by rhgills (2014-01-20 19:41:38+00:00)
Title: Add support for specifying the width of the More button + substantial refactoring and cleanup

The delegate can now specify a width for the More button. This is useful in case you want to achieve something like this:

![move to top](https://f.cloud.github.com/assets/1849147/1957554/dd910d12-820a-11e3-8b1e-988a9f06a045.png)

Which is now easily implemented using:

```
- (CGFloat)tableView:(UITableView *)tableView widthForMoreOptionButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
CGSize sizeThatFits = [self sizeOfText:@"Options"];
return sizeThatFits.width + 30.f;
}

- (CGSize)sizeOfText:(NSString *)string {
UILabel *label = [[UILabel alloc] init];
[label setText:string];
return [label sizeThatFits:label.frame.size];
}
```

I also, as part of understanding how the code worked and of cleaning up after myself when I was done, performed substantial refactorings, which I feel make the code simpler and easier to understand.

Among them, I extracted two additional collaborating classes, seperating the logic for:

- knowing when to configure/teardown the More option view
- configuring or tearing down the More option view
- locating views in the UITableView

It should now be substantially easier to modify the class in case Apple's implementation of UITableView changes— you'll only need to look at the MSCMoreOptionTableViewCellViewLocator instead of all the other logic, which was previously intertwined.

I look forward to hearing your thoughts!