 extension UITextField: StyleableTextContainer {
 
     public final var bonMotStyle: StyleAttributeProvider? {
-        get { return getStyle(object: self) }
-        set { setStyle(object: self, bonMotStyle: newValue) }
+        get { return StyleableSupport.getStyle(object: self) }
+        set { StyleableSupport.setStyle(object: self, bonMotStyle: newValue) }
     }
 
     @objc(bon_styledText)

extension UIButton: StyleableTextContainer {

    public final var bonMotStyle: StyleAttributeProvider? {
        get { return getStyle(object: self) }
        set { setStyle(object: self, bonMotStyle: newValue) }
    }

    @objc(bon_setStyledText:forState:)


}

internal enum StyleableSupport {
    static var containerHandle: UInt8 = 0

    static func getStyle(object theObject: NSObject) -> StyleAttributeProvider? {
        let adaptiveFunctionContainer = objc_getAssociatedObject(theObject, &containerHandle) as? StyleAttributeProviderHolder
        return adaptiveFunctionContainer?.style
    }

    static func setStyle(object theObject: NSObject, bonMotStyle: StyleAttributeProvider?) {
        var adaptiveFunction: StyleAttributeProviderHolder? = nil
        if let bonMotStyle = bonMotStyle {
            adaptiveFunction = StyleAttributeProviderHolder(style: bonMotStyle)
        }
        objc_setAssociatedObject(
            theObject, &containerHandle,
            adaptiveFunction,
            .OBJC_ASSOCIATION_RETAIN_NONATOMIC
        )
        if let traitEnvironment = theObject as? UITraitEnvironment, let container = theObject as? AdaptableTextContainer {
            container.updateText(forTraitCollection: traitEnvironment.traitCollection)
        }
    }
}

