File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import ObjectiveC
55
66public extension UIBarButtonItem {
77
8- /// Binds enabled state of action to button, and subscribes to rx_tap to execute action.
8+ /// Binds enabled state of action to bar button item , and subscribes to rx_tap to execute action.
99 /// These subscriptions are managed in a private, inaccessible dispose bag. To cancel
1010 /// them, set the rx_action to nil or another action.
1111 public var rx_action : CocoaAction ? {
@@ -32,22 +32,8 @@ public extension UIBarButtonItem {
3232 . bindTo ( self . rx_enabled)
3333 . addDisposableTo ( self . actionDisposeBag)
3434
35- // Technically, this file is only included on tv/iOS platforms,
36- // so this optional will never be nil. But let's be safe 😉
37- let lookupControlEvent : ControlEvent < Void > ?
38-
39- #if os(tvOS)
40- lookupControlEvent = self . rx_primaryAction
41- #elseif os(iOS)
42- lookupControlEvent = self . rx_tap
43- #endif
44-
45- guard let controlEvent = lookupControlEvent else {
46- return
47- }
48-
49- controlEvent
50- . subscribeNext { _ -> Void in
35+ self . rx_tap
36+ . subscribeNext {
5137 action. execute ( )
5238 }
5339 . addDisposableTo ( self . actionDisposeBag)
You can’t perform that action at this time.
0 commit comments