Here is what I want to achieve:
I want to subclass an UIScrollView to have additional functionality. This subclass should be able to react on scrolling, so i have to
Another option is to subclass and use the power of abstract functions. For instance, you create
@interface EnhancedTableViewController : UITableViewController
There you override some delegate method and define your abstract function
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// code before interception
[self bfTableView:(UITableView *)tableView didSelectRowAtIndexPath:indexPath];
// code after interception
}
- (void)bfTableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {};
Now all you need to do is to subclass your EnhancedTableViewController and use your abstract functions instead of delegate ones. Like this:
@interface MyTableViewController : EnhancedTableViewController ...
- (void)bfTableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//overriden implementation with pre/post actions
};
Let me know if there is anything wrong here.