mirror of
https://github.com/ReactiveX/RxSwift.git
synced 2024-10-05 06:27:29 +03:00
Adds UIImagePicker
documentation.
This commit is contained in:
parent
ffc976dac9
commit
c6526e830a
@ -10,32 +10,43 @@ import Foundation
|
||||
|
||||
#if os(iOS)
|
||||
import Foundation
|
||||
|
||||
|
||||
#if !RX_NO_MODULE
|
||||
import RxSwift
|
||||
#endif
|
||||
import UIKit
|
||||
|
||||
extension UIImagePickerController {
|
||||
|
||||
public var rx_delegate: DelegateProxy {
|
||||
return proxyForObject(RxImagePickerDelegateProxy.self, self)
|
||||
|
||||
extension UIImagePickerController {
|
||||
|
||||
/**
|
||||
Reactive wrapper for `delegate`.
|
||||
|
||||
For more information take a look at `DelegateProxyType` protocol documentation.
|
||||
*/
|
||||
public var rx_delegate: DelegateProxy {
|
||||
return proxyForObject(RxImagePickerDelegateProxy.self, self)
|
||||
}
|
||||
|
||||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didFinishPickingMediaWithInfo: Observable<[String : AnyObject]> {
|
||||
return rx_delegate
|
||||
.observe("imagePickerController:didFinishPickingMediaWithInfo:")
|
||||
.map({ (a) in
|
||||
return try castOrThrow(Dictionary<String, AnyObject>.self, a[1])
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
Reactive wrapper for `delegate` message.
|
||||
*/
|
||||
public var rx_didCancel: Observable<()> {
|
||||
return rx_delegate
|
||||
.observe("imagePickerControllerDidCancel:")
|
||||
.map {_ in () }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public var rx_didFinishPickingMediaWithInfo: Observable<[String : AnyObject]> {
|
||||
return rx_delegate
|
||||
.observe("imagePickerController:didFinishPickingMediaWithInfo:")
|
||||
.map({ (a) in
|
||||
return try castOrThrow(Dictionary<String, AnyObject>.self, a[1])
|
||||
})
|
||||
}
|
||||
|
||||
public var rx_didCancel: Observable<Void> {
|
||||
return rx_delegate
|
||||
.observe("imagePickerControllerDidCancel:")
|
||||
.map({_ in ()})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user