Skip to content
Permalink
Browse files

Change return type of didFinishPickingMediaWithInfo

  • Loading branch information...
MortyMerr authored and freak4pc committed May 14, 2019
1 parent 5cd1536 commit fb2ff2d7be7780045a3f89107f1e5261dd0a7a09
@@ -18,11 +18,11 @@
/**
Reactive wrapper for `delegate` message.
*/
public var didFinishPickingMediaWithInfo: Observable<[String : AnyObject]> {
public var didFinishPickingMediaWithInfo: Observable<[UIImagePickerController.InfoKey : AnyObject]> {
return delegate
.methodInvoked(#selector(UIImagePickerControllerDelegate.imagePickerController(_:didFinishPickingMediaWithInfo:)))
.map({ (a) in
return try castOrThrow(Dictionary<String, AnyObject>.self, a[1])
return try castOrThrow(Dictionary<UIImagePickerController.InfoKey, AnyObject>.self, a[1])
})
}

@@ -33,7 +33,7 @@ class ImagePickerController: ViewController {
.take(1)
}
.map { info in
return info[UIImagePickerController.InfoKey.originalImage.rawValue] as? UIImage
return info[.originalImage] as? UIImage
}
.bind(to: imageView.rx.image)
.disposed(by: disposeBag)
@@ -50,7 +50,7 @@ class ImagePickerController: ViewController {
.take(1)
}
.map { info in
return info[UIImagePickerController.InfoKey.originalImage.rawValue] as? UIImage
return info[.originalImage] as? UIImage
}
.bind(to: imageView.rx.image)
.disposed(by: disposeBag)
@@ -65,7 +65,7 @@ class ImagePickerController: ViewController {
.take(1)
}
.map { info in
return info[UIImagePickerController.InfoKey.editedImage.rawValue] as? UIImage
return info[.editedImage] as? UIImage
}
.bind(to: imageView.rx.image)
.disposed(by: disposeBag)

0 comments on commit fb2ff2d

Please sign in to comment.
You can’t perform that action at this time.