You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.2 KiB
40 lines
1.2 KiB
1 year ago
|
//
|
||
|
// RxImagePickerDelegateProxy.swift
|
||
|
// RxExample
|
||
|
//
|
||
|
// Created by Segii Shulga on 1/4/16.
|
||
|
// Copyright © 2016 Krunoslav Zaher. All rights reserved.
|
||
|
//
|
||
|
|
||
|
import RxSwift
|
||
|
import RxCocoa
|
||
|
import UIKit
|
||
|
|
||
|
//图片选择控制器(UIImagePickerController)代理委托
|
||
|
public class RxImagePickerDelegateProxy :
|
||
|
DelegateProxy<UIImagePickerController,
|
||
|
UIImagePickerControllerDelegate & UINavigationControllerDelegate>,
|
||
|
DelegateProxyType,
|
||
|
UIImagePickerControllerDelegate,
|
||
|
UINavigationControllerDelegate {
|
||
|
|
||
|
public init(imagePicker: UIImagePickerController) {
|
||
|
super.init(parentObject: imagePicker,
|
||
|
delegateProxy: RxImagePickerDelegateProxy.self)
|
||
|
}
|
||
|
|
||
|
public static func registerKnownImplementations() {
|
||
|
self.register { RxImagePickerDelegateProxy(imagePicker: $0) }
|
||
|
}
|
||
|
|
||
|
public static func currentDelegate(for object: UIImagePickerController)
|
||
|
-> (UIImagePickerControllerDelegate & UINavigationControllerDelegate)? {
|
||
|
return object.delegate
|
||
|
}
|
||
|
|
||
|
public static func setCurrentDelegate(_ delegate: (UIImagePickerControllerDelegate
|
||
|
& UINavigationControllerDelegate)?, to object: UIImagePickerController) {
|
||
|
object.delegate = delegate
|
||
|
}
|
||
|
}
|