Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing contactPickerView parameter in all delegate methods #33

Open
tomaskraina opened this issue Mar 16, 2015 · 1 comment
Open

Missing contactPickerView parameter in all delegate methods #33

tomaskraina opened this issue Mar 16, 2015 · 1 comment

Comments

@tomaskraina
Copy link
Contributor

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
@tristanhimmelman
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants