From 08a3161354b971f3b671f4ffebd134d7f747ca63 Mon Sep 17 00:00:00 2001 From: Mark Woollard Date: Sat, 23 Jan 2016 18:51:10 +0000 Subject: [PATCH] Rx wrapper for UITableViewDelegate tableView:accessoryButtonTappedForRowWithIndexPath: method --- RxCocoa/iOS/UITableView+Rx.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/RxCocoa/iOS/UITableView+Rx.swift b/RxCocoa/iOS/UITableView+Rx.swift index 678bda59..e5c78bfb 100644 --- a/RxCocoa/iOS/UITableView+Rx.swift +++ b/RxCocoa/iOS/UITableView+Rx.swift @@ -148,6 +148,18 @@ extension UITableView { return ControlEvent(events: source) } + /** + Reactive wrapper for `delegate` message `tableView:accessoryButtonTappedForRowWithIndexPath:`. + */ + public var rx_itemAccessoryButtonTapped: ControlEvent { + let source: Observable = rx_delegate.observe("tableView:accessoryButtonTappedForRowWithIndexPath:") + .map { a in + return a[1] as! NSIndexPath + } + + return ControlEvent(events: source) + } + /** Reactive wrapper for `delegate` message `tableView:commitEditingStyle:forRowAtIndexPath:`. */