shiba1014
shiba1014

Reputation: 69

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

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.

Upvotes: 1

Views: 2192

Answers (1)

MeXx
MeXx

Reputation: 3357

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.

Upvotes: 1

Related Questions