Skip to content

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