HMSegmentedControl icon indicating copy to clipboard operation
HMSegmentedControl copied to clipboard

Add an method to handle select common segment

Open HLTangbinbin opened this issue 5 years ago • 0 comments

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

HLTangbinbin avatar May 09 '19 08:05 HLTangbinbin