Skip to content

Commit

Permalink
Replaces DelegateProxy delegate conformance to NSObjectProtocol w…
Browse files Browse the repository at this point in the history
…ith `AnyObject`. ReactiveX#1442
  • Loading branch information
kzaher committed Oct 17, 2017
1 parent fc6de4f commit bb83428
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions RxCocoa/Common/DelegateProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/// Base class for `DelegateProxyType` protocol.
///
/// This implementation is not thread safe and can be used only from one thread (Main thread).
open class DelegateProxy<P: AnyObject, D: NSObjectProtocol>: _RXDelegateProxy {
open class DelegateProxy<P: AnyObject, D: AnyObject>: _RXDelegateProxy {
public typealias ParentObject = P
public typealias Delegate = D

Expand Down Expand Up @@ -171,7 +171,7 @@
return
}

guard (self.forwardToDelegate()?.responds(to: selector) ?? false) || voidDelegateMethodsContain(selector) else {
guard ((self.forwardToDelegate() as? NSObject)?.responds(to: selector) ?? false) || voidDelegateMethodsContain(selector) else {
rxFatalError("This class doesn't respond to selector \(selector)")
}
}
Expand All @@ -190,7 +190,7 @@
/// through `self`.
///
/// - returns: Value of reference if set or nil.
public func forwardToDelegate() -> Delegate? {
open func forwardToDelegate() -> Delegate? {
return castOptionalOrFatalError(self._forwardToDelegate)
}

Expand Down
2 changes: 1 addition & 1 deletion RxCocoa/Common/DelegateProxyType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Since RxCocoa needs to automagically create those Proxys and because views that
RxScrollViewDelegateProxy.register { RxTableViewDelegateProxy(parentObject: $0) }
*/
public protocol DelegateProxyType : AnyObject {
public protocol DelegateProxyType: class {
associatedtype ParentObject: AnyObject
associatedtype Delegate: AnyObject

Expand Down

0 comments on commit bb83428

Please sign in to comment.