Chapter 11: value of type 'Reactive<UIButton>' has no member 'tap'

Hello, on Chapter 11 “timeout” section I get this error when I try to access the RxCocoa button taps.

 error: value of type 'Reactive<UIButton>' has no member 'tap'
let _ = button.rx.tap
        ~~~~~~~~~ ^~~

I have verified that everything is imported at the top of playground.

import UIKit
import RxSwift
import RxCocoa

//----

/ / the error is triggered on this part
let _ = button.rx.tap
    .map { _ in "•" }
    .timeout(5, other: Observable.just("X"), scheduler: MainScheduler.instance)
    .subscribe(tapsTimeline)

// ----

I tried searching on stackoverflow etc… unfortunately I didn’t find relevant solution.
Any thoughts on this?

Thanks in advance.

My bad, I fixed the issue by changing the scheme at the top to “RxCocoa” instead of RxSwift and build again, then it worked.

@mussacharles Really glad you sorted it out!

1 Like