为什么rx.text/rx.observe/rx.etc不可用(RxSwift)

Ang*_*o A 1 swift rx-swift

我用Cocoapods创建了一个简单的项目,并安装了RxSwift和RxCocoa.

我写了这段代码:

import UIKit
import RxSwift

class ViewController: UIViewController {

    @IBOutlet weak var field: UITextField!

    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        //self.field.rx. (only suggests `base`)
    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }


}
Run Code Online (Sandbox Code Playgroud)

所以我应该能够做self.field.rx.text对吗?但我只能得到self.field.rx.base

我错过了什么?

pab*_*ros 5

你也必须import RxCocoa在顶部添加