:warning: If you don't have something to report in the following format, it will probably be easier and faster to ask in the slack channel first. :warning:
:warning: Please take you time to fill in the fields below. If we aren't provided with this basic information about your issue we probably won't be able to help you and there won't be much we can do except to close the issue :( :warning:
If you still want to report issue, please delete above statements before submitting an issue.
I have a simple Swift project with RxCocoa and RxSwift on the cocoapods. When one of the files has
import RxSwift
I get "No such module" error. If I run the app on the simulator it goes away but there is no autocomplete like this and it makes it really hard to start working with RxSwift.
Expected outcome:
Helpful autocomplete
What actually happens:
There is no autocomplete
Self contained code example that reproduces the issue:
import RxSwift
**RxSwift/RxCocoa/RxBlocking/RxTest version/commit**
_3.0_
**Platform/Environment**
- [ x] iOS
- [ ] macOS
- [ ] tvOS
- [ ] watchOS
- [ ] playgrounds
**How easy is to reproduce? (chances of successful reproduce after running the self contained code)**
- [ x] easy, 100% repro
- [ ] sometimes, 10%-100%
- [ ] hard, 2% - 10%
- [ ] extremely hard, %0 - 2%
**Xcode version**:
Version 8.2.1
```
:warning: Fields below are optional for general issues or in case those questions aren't related to your issue, but filling them out will increase the chances of getting your issue resolved. :warning:
Installation method:
I have multiple versions of Xcode installed:
(so we can know if this is a potential cause of your issue)
Level of RxSwift knowledge:
(this is so we can understand your level of knowledge
and formulate the response in an appropriate manner)
I think this issue related to Xcode rather then library 😜
You can do like this
import RxSwift
import RxCocoa
class LoginViewController: UIViewController {
@IBOutlet fileprivate var tfUsername: UITextField!
@IBOutlet fileprivate var tfPassword: UITextField!
@IBOutlet fileprivate var btLogin: UIButton!
var disposeBag = DisposeBag()
override func viewDidLoad() {
super.viewDidLoad()
let usernameControlProperty = tfUsername.rx.text
let usernameValid = usernameControlProperty.orEmpty
.map { (string) in string.characters.count >= 5}
.shareReplay(1)
// ...
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
I'm not sure what to do with this.
All of our unit tests are passing.
I can understand how malfunctioning autocomplete can be frustrating, but this is not an issue with this project. If it compiles, it's valid Swift code.
As far as I can tell, it does work for fresh projects, so there is maybe something in your configuration that is wrong.
I would suggest trying to create more public pressure on Apple to fix their toolchain, although even that tactic will probably fail.
¯\_(ツ)_/¯ , sorry
Most helpful comment
You can do like this
import RxSwift
import RxCocoa
class LoginViewController: UIViewController {
@IBOutlet fileprivate var tfUsername: UITextField!
@IBOutlet fileprivate var tfPassword: UITextField!
@IBOutlet fileprivate var btLogin: UIButton!
}