杨锴
2024-08-14 909e20941e45f8712c012db602034b47da0bfdb0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
//  RxSearchControllerDelegateProxy.swift
//  RxCocoa
//
//  Created by Segii Shulga on 3/17/16.
//  Copyright © 2016 Krunoslav Zaher. All rights reserved.
//
 
#if os(iOS) || os(visionOS)
 
import RxSwift
import UIKit
 
extension UISearchController: HasDelegate {
    public typealias Delegate = UISearchControllerDelegate
}
 
/// For more information take a look at `DelegateProxyType`.
open class RxSearchControllerDelegateProxy
    : DelegateProxy<UISearchController, UISearchControllerDelegate>
    , DelegateProxyType {
 
    /// Typed parent object.
    public weak private(set) var searchController: UISearchController?
 
    /// - parameter searchController: Parent object for delegate proxy.
    public init(searchController: UISearchController) {
        self.searchController = searchController
        super.init(parentObject: searchController, delegateProxy: RxSearchControllerDelegateProxy.self)
    }
    
    // Register known implementations
    public static func registerKnownImplementations() {
        self.register { RxSearchControllerDelegateProxy(searchController: $0) }
    }
}
 
extension RxSearchControllerDelegateProxy: UISearchControllerDelegate {}
   
#endif