Sk0rpion/MagicPie — pull request #10 by maduperera (2014-06-03 06:14:49+00:00)
Title: Added indexing ability to pie elements

Recently when we were using this awesome library we found that it'll be more convenient to know what's the exact pie element that is tapped being mapped with the input array index. That is if the the input values are in an array as below,
float vals[] = {505.0,505.0,0.0,70.0,0.0};
then when the relative pie element is tapped there's no way to identify which pie element is mapped with the index of the above array elements. It gets worse when the there are identical values in the array as above. for example which 505.0 is the user tapped in the pie chart? is it the element at 0th index or at index 1.

For that reason I have added another overload init method that will map the array index as well.
+ (instancetype)pieElementWithValue:(float)val indexValue:(NSInteger*)index color:(UIColor*)color;

Hope this may be convenient to others in their developments.