Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions XYPieChart/XYPieChart.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
- (void)pieChart:(XYPieChart *)pieChart didSelectSliceAtIndex:(NSUInteger)index;
- (void)pieChart:(XYPieChart *)pieChart willDeselectSliceAtIndex:(NSUInteger)index;
- (void)pieChart:(XYPieChart *)pieChart didDeselectSliceAtIndex:(NSUInteger)index;
- (BOOL)pieChart:(XYPieChart *)pieChart ShouldSelectSliceAtIndex:(NSUInteger)index;
@end

@interface XYPieChart : UIView
Expand Down
5 changes: 5 additions & 0 deletions XYPieChart/XYPieChart.m
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,11 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event

- (void)notifyDelegateOfSelectionChangeFrom:(NSUInteger)previousSelection to:(NSUInteger)newSelection
{
if ([_delegate respondsToSelector:@selector(pieChart:ShouldSelectSliceAtIndex:)]) {
if (![_delegate pieChart:self ShouldSelectSliceAtIndex:newSelection]) {
return;
};
}
if (previousSelection != newSelection){
if(previousSelection != -1){
NSUInteger tempPre = previousSelection;
Expand Down