Enum with associated value as stored property in Swift extension
First note that your var connectionState is  computed property,
not a stored property. It is computed using the get and set
methods. Extensions cannot add stored properties to a type.

Your current implementation crashes if the connection state is retrieved
without having been set before:

let provider = ServiceProvider()
print(provider.connectionState)


because at

let dict = NSDictionary()
dict.setValue(nil, forKey: "none")


dict is an immutable dictionary. Making it mutable does not solve the
problem 

let dict = NSMutableDictionary()
dict.setValue(nil, forKey: "none")


because the second statement has no effect and therefore the assertion

assert(!dict.isEmpty, "dict must contain one key")


fails. 

You want to create a NSDictionary which – when bridged to [String: Error?] – becomes ["none": nil]. The difficulty here is that the
value type of the Swift dictionary is an optional. But it is possible,
using NSNull():

    get {
        if let connectionStateDict = objc_getAssociatedObject(self, &amp;ConnectionStateHolderKey) as? NSDictionary {
            return connectionStateDict
        }
        return ["none": NSNull()]
    }


(compare SE-0140 Warn when Optional converts to Any, and bridge Optional As Its Payload Or NSNull).

But: All these conversions between enum, Swift dictionary and NSDictionary
are actually not needed, you can achieve the same much simpler.

As stated in Swift Blog: Objective-C id as Swift Any,


  The Objective-C bridge in Swift 3 can in turn present any Swift value as an id-compatible object to Objective-C.


This means that you can pass an enum ConnectionState directly to objc_setAssociatedObject()
and conditionally cast the return value from objc_getAssociatedObject() back to the enum.
The Swift runtime automatically wraps the value into a class.
(AnyObject not working in Xcode8 beta6?
on Stack Overflow contains further information and links.)

So this is everything you need:

enum ConnectionState {
    case none, connecting, failed(Error), connected, disconnected(Error), blocked
}

private var ConnectionStateHolderKey: UInt8 = 7
extension ServiceProvider {

    var connectionState: ConnectionState {
        get {
            if let connectionState = objc_getAssociatedObject(self, &amp;ConnectionStateHolderKey) as? ConnectionState {
                return connectionState
            }
            return .none
        }
        set {
            objc_setAssociatedObject(self, &amp;ConnectionStateHolderKey, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        }
    }
}


More suggestions:


Use the nil-coalescing operator ?? to provide a default value in the getter method.
Restrict the scope of the associated objects key by making it a static property inside extension ServiceProvider.


Then the code would look like this:

extension ServiceProvider {

    private struct Keys {
        static var connectionState : UInt8 = 7
    } 

    var connectionState: ConnectionState {
        get {
            return (objc_getAssociatedObject(self, &amp;ServiceProvider.Keys.connectionState) as? ConnectionState) ?? .none
        }
        set {
            objc_setAssociatedObject(self, &amp;ServiceProvider.Keys.connectionState, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        }
    }
}


Finally: Your enum has a case none for "no state". But the Swift way
of representing "no value" is to use an optional:

enum ConnectionState {
    case connecting, failed(Error), connected, disconnected(Error), blocked
}

extension ServiceProvider {

    private struct Keys {
        static var connectionState : Int = 0
    } 

    var connectionState: ConnectionState? {
        get {
            return objc_getAssociatedObject(self, &amp;ServiceProvider.Keys.connectionState) as? ConnectionState
        }
        set {
            objc_setAssociatedObject(self, &amp;ServiceProvider.Keys.connectionState, newValue, .OBJC_ASSOCIATION_RETAIN_NONATOMIC)
        }
    }
}