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

Add an method to handle select common segment #338

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

HLTangbinbin
Copy link

To handle touch common segment, it is need to add a condition.
if (segment != self.selectedSegmentIndex && segment < sectionsCount) { // Check if we have to do anything with the touch event if (self.isTouchEnabled) [self setSelectedSegmentIndex:segment animated:self.shouldAnimateUserSelection notify:YES]; }else { //Handle the index not changed if (self.indexChangeBlock) { self.indexChangeBlock(segment, NO); } }
and use the origin indexChangeBock to add a parameter to judge if the index is changed:
typedef void (^IndexChangeBlock)(NSUInteger index, BOOL isChange)
With minimal changes, it is easier for users to handle different events,I sincerely hope that the owner can adopt this submission to make it more convenient for developers

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

Successfully merging this pull request may close these issues.

1 participant