title: How do I re-write this code for XYPieChart into Swift?
body: <p>I'm trying to make a pie chart using XYPieChart in my Swift app, but I don't know how to retrieve the values using Swift. I have this code written in Objective-C, and need to write it in Swift.  Does anyone know how to do that? </p>
  
  <pre><code>- (NSUInteger)numberOfSlicesInPieChart:(XYPieChart *)pieChart {
  return self.values.count;
  }
  
  - (CGFloat)pieChart:(XYPieChart *)pieChart valueForSliceAtIndex:(NSUInteger)index {
  NSNumber* value = self.values[index];
  return value.doubleValue;
  }
  
  - (UIColor *)pieChart:(XYPieChart *)pieChart colorForSliceAtIndex:(NSUInteger)index;    
  
  - (NSString *)pieChart:(XYPieChart *)pieChart textForSliceAtIndex:(NSUInteger)index;    //optional
  </code></pre>