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

More customisability. #81

Open
alloy opened this issue Feb 17, 2014 · 1 comment
Open

More customisability. #81

alloy opened this issue Feb 17, 2014 · 1 comment

Comments

@alloy
Copy link

alloy commented Feb 17, 2014

I’m looking at creating a PR to make customising the view classes more easy. For my personal requirements I’m going to start out by just adding:

@implementation TITokenFieldView
- (Class)tokenFieldClass;
{
  return [TITokenField class];
}
@end

@implementation TITokenField
- (Class)tokenClass;
{
  return [TIToken class];
}
@end

However, this might not what you want for a PR, as it would always require a user to override both classes to customise the TIToken class. Other options are to:

  • Pass a dictionary of class mappings to TITokenFieldView that gets passed along to the TITokenField instance.
  • Add properties to the TITokenFieldView and TITokenField classes that specify the classes to use.
  • Add delegate methods that return either classes or, (mainly) in the case of TIToken return an instance, akin to -[UITableViewDataSource tableView:cellForRowAtIndexPath:].

If you can let me know if and how you would want this to be, then I will submit a PR for that.

@thermogl
Copy link
Owner

I've always liked the class approach, feel free to submit a pull request along these lines :)

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