3

I'm having problem with RxSwift and RxCocoa. I have update to latest version 3.3 and Xcode 8.3 But there are problem with autocomplete feature with RxCocoa.

Every time I write textfield.rx.text. There will be no autocomple

import UIKit
import RxSwift
import RxCocoa

class FirstViewController: UIViewController {

@IBOutlet weak var textField2: UITextField!
@IBOutlet weak var textField1: UITextField!

var textField1Observerble: Driver<String?>!
var textField2Observerble: Driver<String?>!


override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
    textField1.rx.text.
}

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


}

How can we fix that?

halfer
  • 19,824
  • 17
  • 99
  • 186
Lê Khánh Vinh
  • 2,591
  • 5
  • 31
  • 77

1 Answers1

1

There is a workaround:

You could add asObservable() at the end and then use dot operator to get auto complete suggestion like the following:

textField1.rx.text.asObservable().
Juan Serrats
  • 1,358
  • 5
  • 24
  • 30
Ken Siu
  • 11
  • 2