3

I currently have a UIButton that uses rx.tap function of RxSwift to dismiss a UIVIewController

button.rx.tap
        .subscribe(onNext: { [weak self] in
            self?.navigationController?.dismiss(animated: true, completion: nil)
        })
        .disposed(by: disposeBag)

How can I implement the same function to an ASButtonNode object (from AsyncDisplayKit)

I tried with the below code

buttonNode.rx.tap
        .subscribe(onNext: { [weak self] in
            self?.navigationController?.dismiss(animated: true, completion: nil)
        })
        .disposed(by: disposeBag)

But I get an error saying Ambiguous reference to member 'tap'

Or is there any alternative for this.

  • Should not you be using some RX extension for ASDK ? something like https://github.com/Hxucaa/RxAsyncDisplayKit – Amr Eladawy Mar 26 '17 at 18:29

1 Answers1

0

ASButtonNode class is not inherited from UIButton, its child from ASControlNode : ASDisplayNode : NSObject;

So for support this behaviour you must implement similar logic from RXSwift to ASButtonNode, you can find it on github for UIButton. do similar logic for ASButtonNode and push it on github :) .

Bimawa
  • 3,535
  • 2
  • 25
  • 45