             }
             else {
                 let style = Style()
-                self.style = style
+                setAssociatedObject(self, &CGContext_Style_Key, style)
                 return style
             }
         }

    }

    func with(style:Style, block:() -> Void) {
        CGContextSaveGState(self)
        self.apply(style)
        block()
        CGContextRestoreGState(self)
    }
}

        }
    }

    func apply(newStyle:Style) {
        if let fillColor = newStyle.fillColor {
            setFillColor(fillColor)
        }
        if let strokeColor = newStyle.strokeColor {
            setStrokeColor(strokeColor)
        }
        if let lineWidth = newStyle.lineWidth {
            setLineWidth(lineWidth)
        }
        if let lineCap = newStyle.lineCap {
            setLineCap(lineCap)
        }
        if let lineJoin = newStyle.lineJoin {
            setLineJoin(lineJoin)
        }
        if let miterLimit = newStyle.miterLimit {
            setMiterLimit(miterLimit)
        }
        if let lineDash = newStyle.lineDash {
            setLineDash(lineDash, phase: 0.0)
        }
        if let lineDashPhase = newStyle.lineDashPhase {
            // TODO
        }
        if let flatness = newStyle.flatness {
            setFlatness(flatness)
        }
        if let alpha = newStyle.alpha {
            setAlpha(alpha)
        }
        if let blendMode = newStyle.blendMode {
            setBlendMode(blendMode)
        }
    }
