Value of type 'UIButton' has no member 'reactive'

2.1k views Asked by At

I want to use ReactiveSwift.

  1. Podfile

pod 'ReactiveCocoa', '~> 6.0'

  1. $ pod install

ViewController.swift:

import UIKit
import ReactiveSwift

class ViewController: UIViewController {
    @IBOutlet fileprivate weak var button: UIButton!

    override func viewDidLoad() {
        button.reactive.xxx { ... }
    }
}

I have only this error, so I can run when I comment out button.reactive.xxx { ... }.

Tank you.

1

There are 1 answers

0
MeXx On

It's exactly as @NicolasMiari suggested - Reactive Cocoa is split into several parts (since version 5.0 anyway).

Reactive Swift contains the implementation of the core primitives (Signal, SignalProducer, Property, Action) and operators. Notably, this is platform independent.

Reactive Cocoa is built on top of Reactive Swift and adds UIKit and AppKit specific extensions for iOS/macOS via the .reactive property.