杨锴
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
//
//  RxNavigationControllerDelegateProxy.swift
//  RxCocoa
//
//  Created by Diogo on 13/04/17.
//  Copyright © 2017 Krunoslav Zaher. All rights reserved.
//
 
#if os(iOS) || os(tvOS) || os(visionOS)
 
    import UIKit
    import RxSwift
 
    extension UINavigationController: HasDelegate {
        public typealias Delegate = UINavigationControllerDelegate
    }
 
    /// For more information take a look at `DelegateProxyType`.
    open class RxNavigationControllerDelegateProxy
        : DelegateProxy<UINavigationController, UINavigationControllerDelegate>
        , DelegateProxyType {
 
        /// Typed parent object.
        public weak private(set) var navigationController: UINavigationController?
 
        /// - parameter navigationController: Parent object for delegate proxy.
        public init(navigationController: ParentObject) {
            self.navigationController = navigationController
            super.init(parentObject: navigationController, delegateProxy: RxNavigationControllerDelegateProxy.self)
        }
 
        // Register known implementations
        public static func registerKnownImplementations() {
            self.register { RxNavigationControllerDelegateProxy(navigationController: $0) }
        }
    }
 
    extension RxNavigationControllerDelegateProxy: UINavigationControllerDelegate {}
#endif