I have a class named myClass. This class has TouchesMoved and TouchesBegan defined.
This class is used by 3 other classes. But I need to add more code to each of these classes, to the same TouchesMoved and TouchesBegan methods, without overriding the code that is already on its class. I mean, if I add a TouchesBegan method to one of the 3 classes, it will not use the class definition for the method. I would like to be able to, instead, add code, instead of replace.
Example:
MyClass
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self doStuff1];
}
Object1 based on MyClass
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
[self doStuff2];
}
when touchesBegan of Object1 runs, it will call doStuff2 and also doStuff1, instead of just doStuff2.
Is that possible?
thanks