ios - Rx ItemSelected doing action depend on how much action triggered -
i wanna ask rxswift.
got problem when want use tableview delegate function rxswift
don't know source of problem ..
problem when select on cell rx.itemselected , got cell position , event triggered @ first time.
event pushviewcontroller , when pressed previous view. after that, tap again on same cell .. cell triggered twice , if same thing, it'll triggered incremental 1 -> 2 -> 3 -> n+1
there way fix ? here's partial of code :
root.tableview.rx.itemselected.subscribe(onnext: { index in switch index.row : case 0 : dsource.navbar?.pushviewcontroller(nextviewcontroller, animated: true) case 1: source.navbar?.pushviewcontroller(secondviewcontroller, animated: true) default : break }
add disposablebag remove subscription.
let disposebag = disposebag() root.tableview.rx.itemselected.subscribe(onnext: { index in switch index.row case 0: dsource.navbar?.pushviewcontroller(nextviewcontroller, animated: true) case 1: source.navbar?.pushviewcontroller(secondviewcontroller, animated: true) default : break }).adddisposableto(disposebag)
Comments
Post a Comment