Skip to content

Instantly share code, notes, and snippets.

@ShoMasegi
Created November 25, 2018 14:51
Show Gist options
  • Save ShoMasegi/855a8dff8b37b3a527e3503e6cb9edc4 to your computer and use it in GitHub Desktop.
Save ShoMasegi/855a8dff8b37b3a527e3503e6cb9edc4 to your computer and use it in GitHub Desktop.
import RxCocoa
import RxSwift
import UIKit
final class FilledTextFieldDelegateProxy:
DelegateProxy<FilledTextField, FilledTextFieldDelegate>,
FilledTextFieldDelegate,
DelegateProxyType {
init(filledTextField: FilledTextField) {
super.init(parentObject: filledTextField, delegateProxy: FilledTextFieldDelegateProxy.self)
}
static func registerKnownImplementations() {
register { FilledTextFieldDelegateProxy(filledTextField: $0) }
}
static func currentDelegate(for object: FilledTextField) -> FilledTextFieldDelegate? {
return object.delegate
}
static func setCurrentDelegate(_ delegate: FilledTextFieldDelegate?, to object: FilledTextField) {
object.delegate = delegate
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment