Skip to content

Commit

Permalink
Change return type of didFinishPickingMediaWithInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
M0rtyMerr authored and freak4pc committed May 14, 2019
1 parent 5cd1536 commit fb2ff2d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions RxExample/Extensions/UIImagePickerController+Rx.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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])
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit fb2ff2d

Please sign in to comment.