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

//
// 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
}
}