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

New feature : "inactive (disabled)" segmentIndicator #28

Open
colasbd opened this issue Jun 17, 2015 · 2 comments
Open

New feature : "inactive (disabled)" segmentIndicator #28

colasbd opened this issue Jun 17, 2015 · 2 comments

Comments

@colasbd
Copy link

colasbd commented Jun 17, 2015

A segmentIndicator could "refuse" to be selected.

There would different colors for the title of such a segmentIndicator.

What do you think?

Otherwise, your lib is great, thanxx!

@colasbd
Copy link
Author

colasbd commented Jun 17, 2015

roadmap:

  • add interface for disabling; idea: by a delegate
    -(BOOL)segmentedControl:(NYSegmentedControl *)sc isIndicatorEnabledAtIndex:(NSUInteger)index
  • new settings for the color of the disabled indicators
  • implement disabling:
    1. if one tap : nothing happens (easy)
    2. sliding : more difficult? I have no idea (have to look at your code)
    3. when selected by code: nothing happens (easy)

----> what do you think?

@colasbd
Copy link
Author

colasbd commented Jun 18, 2015

BETTER idea:

add a delegate for the "should select"

@protocol NYSegmentedControlDelegate <NSObject>

- (BOOL)segmentedControl:(NYSegmentedControl *)segmentedControl shouldSelectIndex:(NSUInteger)index ;

@end

add a datasourcer for the color

@protocol NYSegmentedControlStyler <NSObject>

- (UIColor *)segmentedControl:(NYSegmentedControl *)segmentedControl colorForTitleAtIndex:(NSUInteger)index ;
- (UIFont *)segmentedControl:(NYSegmentedControl *)segmentedControl fontForTitleAtIndex:(NSUInteger)index ;

@end

What do you think? Good idea? I might need help for managing the case of sliding when a indicator is not selectable.

But for the rest, if you are OK, I can do a PR.

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

1 participant