UILabelは rx.tap
が使えない
そこで、UITapGestureRecognizer を使ってタップに対応させる
swift
@IBOutlet private var profileDescription: UILabel!
...
let gesture = UITapGestureRecognizer()
profileDescription.addGestureRecognizer(gesture)
gesture.rx.event.asSignal()
.emit(onNext: { [weak self] state in
guard let self = self else { return }
let viewController = XXXXX
self.navigationController?.pushViewController(viewController, animated: true)
}).disposed(by: disposeBag)
事前に
User Interaction Enabled
をONにしとかないといけない!