how to pass value into CGFloat - : I have a the following code which is cocoa touch class, which draws a simple pie chart, and with the value CGFloat I can adjust the image to show the correct information.

how can i pass a value for example from a slider in the main view controler.swift to it, instead of having it fixed?


    public class PieChart : NSObject {

    

    public class func drawCanvas1(ratio ratio: CGFloat = 0.75) {

        //// Variable Declarations
        let expression: CGFloat = 90 + ratio * 360

        
        let ovalPath = UIBezierPath(ovalInRect: CGRect(x: 0, y: -0, width: 112, height: 112))
        UIColor.blackColor().setFill()
        ovalPath.fill()


        
        let oval2Rect = CGRect(x: 4, y: 4, width: 104, height: 104)
        let oval2Path = UIBezierPath()
        oval2Path.addArcWithCenter(CGPoint(x: oval2Rect.midX, y: oval2Rect.midY), radius: oval2Rect.width / 2, startAngle: -expression * CGFloat(M_PI)/180, endAngle: -90 * CGFloat(M_PI)/180, clockwise: true)
        oval2Path.addLineToPoint(CGPoint(x: oval2Rect.midX, y: oval2Rect.midY))
        oval2Path.closePath()

        UIColor.redColor().setFill()
        oval2Path.fill()
    }

}
