diff --git a/RxCocoa/Common/Reactive.swift b/RxCocoa/Common/Reactive.swift index b803379c..f6661fd2 100644 --- a/RxCocoa/Common/Reactive.swift +++ b/RxCocoa/Common/Reactive.swift @@ -22,7 +22,7 @@ */ -public struct Reactive { +public struct Reactive { public let base: Base public init(_ base: Base) { @@ -30,11 +30,18 @@ public struct Reactive { } } -/** - Extend NSObject with `rx` proxy. -*/ -public extension NSObjectProtocol { +public protocol ReactiveCompatible { + associatedtype CompatibleType + var rx: Reactive { get } +} + +public extension ReactiveCompatible { public var rx: Reactive { return Reactive(self) } } + +/** + Extend NSObject with `rx` proxy. +*/ +extension NSObject: ReactiveCompatible { }