 		CGContextSetAllowsAntialiasing(context, true)
 		CGContextSetShouldAntialias(context, true)
 		
-		CGContextSetInterpolationQuality(context, kCGInterpolationHigh)
+		CGContextSetInterpolationQuality(context, CGInterpolationQuality.High)
 		
 		let line = CTLineCreateWithAttributedString(string)
-		let runs = CTLineGetGlyphRuns(line) as! Array<CTRun>
-		
+        let runs: CFArrayRef = CTLineGetGlyphRuns(line)
+        
 		var linePos: CGFloat = 0
 		let charSpacing: CGFloat
 		let align: NSTextAlignment


				let length = length - (samples[i-1].length + len1)

				let deltaAngle = arcFi(samples[i+1].angle, samples[i].angle)
				let orientation = (compareAngles(samples[i+1].angle-CGFloat.Pi/2, samples[i+1].angle, samples[i].angle) > 0 ? -1 : 1)
				
				return samples[i].angle + deltaAngle * CGFloat(orientation) * (min(1, length/len1) + max(0, (length-len1)/len2)) / 2
			}

		super.init(frame: frame)
	}
	
	required init?(coder aDecoder: NSCoder) {
		super.init(coder: aDecoder)
	}
	
	override func drawRect(rect: CGRect) {
		if let bezierString = bezierString {
			bezierString.drawAttributedString(self.attributedText!, toContext: UIGraphicsGetCurrentContext()!, align: _textAlignment, yOffset: textPathOffset)
		} else {
			super.drawRect(rect)
		}
