     }
 }
 
-// MARK: - Boilerplate code to store properties in Extensions
-// Credit: Tikitu de Jager
-// https://medium.com/@ttikitu/swift-extensions-can-add-stored-properties-92db66bce6cd#.5fzpv9dbd
+// MARK: - Boilerplate code to store properties in Extensions using Associated Objects
+
 class ExtensionStoredPropertyHandler {
     static var danceKey: UInt8 = 0
     static func associatedObject<ValueType: AnyObject>(base: AnyObject, key: UnsafePointer<UInt8>, initialiser: () -> ValueType) -> ValueType {



// MARK: - UIView Extension for Dance
@available(iOS 10.0, *)
extension UIView {
    var dance: Dance {
        get {
            return ExtensionStoredPropertyHandler.associatedObject(base: self, key: &ExtensionStoredPropertyHandler.danceKey) {
                return Dance(dancingView: self)


// MARK: - CGFloatConvertable Extension for Double, Float, CGFloat
// (in order to accept non-CGFloats in setProgress(to:))

public protocol CGFloatConvertable {
    func convertToCGFloat() -> CGFloat
}

extension Double: CGFloatConvertable {
    public func convertToCGFloat() -> CGFloat {
        return CGFloat(self)
    }
}

extension Float: CGFloatConvertable {
    public func convertToCGFloat() -> CGFloat {
        return CGFloat(self)
    }
}

extension CGFloat: CGFloatConvertable {
    public func convertToCGFloat() -> CGFloat {
        return self
    }
