API Design
The latest post from Matt Gemmell is a must-read for Cocoa developers. I find myself thinking a lot about APIs when writing code, for all classes, even “internal” classes.
However, I noticed this delegate method in the section If a convention is broken, throw it away:
- (BOOL)isTileEnabled:(NSInteger)tileNumber inMenu:(MGTileMenuController *)tileMenu;
I think the naming is confusing. It could be confused for an accessor method, which would return the current state of that tile. Yes, I know, it’s a delegate method, so it would not make much sense. Still, I would have instead used the following name:
- (BOOL)shouldEnableTile:(NSInteger)tileNumber inMenu:(MGTileMenuController *)tileMenu;
