@@ -74,6 +74,10 @@ extension DelegateProxyTest {
74
74
func test_UIPickerViewExtension( ) {
75
75
performDelegateTest ( UIPickerViewSubclass ( frame: CGRect . zero) )
76
76
}
77
+
78
+ func test_UIPickerViewDataSourceExtension( ) {
79
+ performDelegateTest ( UIPickerViewSubclass2 ( frame: CGRect . zero) )
80
+ }
77
81
}
78
82
#endif
79
83
@@ -390,6 +394,37 @@ final class UIPickerViewSubclass
390
394
onProxyForObject: self )
391
395
}
392
396
}
397
+
398
+ final class ExtendPickerViewDataSourceProxy
399
+ : RxPickerViewDataSourceProxy
400
+ , TestDelegateProtocol {
401
+ weak fileprivate( set) var control : UIPickerViewSubclass2 ?
402
+
403
+ required init ( parentObject: AnyObject ) {
404
+ self . control = ( parentObject as! UIPickerViewSubclass2 )
405
+ super. init ( parentObject: parentObject)
406
+ }
407
+ }
408
+
409
+ final class UIPickerViewSubclass2 : UIPickerView , TestDelegateControl {
410
+ override func createRxDataSourceProxy( ) -> RxPickerViewDataSourceProxy {
411
+ return ExtendPickerViewDataSourceProxy ( parentObject: self )
412
+ }
413
+
414
+ func doThatTest( _ value: Int ) {
415
+ if dataSource != nil {
416
+ ( dataSource as! TestDelegateProtocol ) . testEventHappened ? ( value)
417
+ }
418
+ }
419
+
420
+ var delegateProxy : DelegateProxy {
421
+ return self . rx. dataSource
422
+ }
423
+
424
+ func setMineForwardDelegate( _ testDelegate: TestDelegateProtocol ) -> Disposable {
425
+ return RxPickerViewDataSourceProxy . installForwardDelegate ( testDelegate, retainDelegate: false , onProxyForObject: self )
426
+ }
427
+ }
393
428
394
429
final class ExtendWebViewDelegateProxy
395
430
: RxWebViewDelegateProxy
0 commit comments