THContactPicker
THContactPicker copied to clipboard
Missing contactPickerView parameter in all delegate methods
A parameter that contains a reference to a sender (an instance of THContactPickerDelegate
) is missing in all delegate methods. This violates both the best practice for delegate pattern and makes it difficult to handle multiple THContactPickerView
instances in one single delegate.
For example when you have multiple contact pickers on one screen and all of them have the same delegate which is a view controller.
Proposed THContactPickerDelegate
protocol should look like this:
@protocol THContactPickerDelegate <NSObject>
- (void)contactPicker:(THContactPickerView *)contactPickerView textViewDidChangeToText:(NSString *)text;
- (void)contactPicker:(THContactPickerView *)contactPickerView didRemoveContact:(id)contact;
- (void)contactPickerDidResize:(THContactPickerView *)contactPickerView;
- (BOOL)contactPicker:(THContactPickerView *)contactPickerView textFieldShouldReturn:(UITextField *)textField;
@end
Hi @tomaskraina, I am in agreement with these recommendations and what you bring up in #34. If you have the time to create a Pull Request with these updates that would be great! Otherwise, it will take some time for me to get to this. Thanks