AppCode doesn't prompt RxSwift classes and some other installed CocoaPods
Asked Answered
T

4

12

I have installed newest version of RxSwift by CocoaPods.

While trying to use simple elements of RxSwift, like NotificationsCenter.default.rx it doesn't prompt methods to use. Interestingly sometimes it prompts for other pods and sometimes not for the rest so I have to open XCode for checking code correction.

How can I fix that?

Titmouse answered 21/11, 2017 at 19:8 Comment(0)
O
3

You need to wait for this problem to be fixed, sorry for that.

UPD: fixed in 2018.1 EAP, see here

Obeah answered 1/12, 2017 at 9:31 Comment(1)
I'm still seeing this issue in version 2018.1. Method prompts for RxCocoa aren't working and cmd+b on the "rx" in button.rx shows the "Cannot find declaration to go" error popup. Any ideas? Thanks!Perpend
P
2

I experience that a lot as well. One of the ways that I make it work if one of my CocoaPods is not installed correctly is to remove the pods and the .xcworkspace file, and then close xcode, and do a pod install. This should help.

Hope it helps :)

--- Edit ---

If that doesn't help, try to remove the import RxSwift, and do a clean and build again :)

Pickerelweed answered 30/11, 2017 at 17:9 Comment(0)
T
0

You can actually kind of have autocompletion in Appcode if you declare your type explicitly. The only issue is you will have to look up the Base for Reactive<Base> since Appcode considers all rx extensions to be NSObject by default. For example:

import RxSiwft
import RxCocoa

...

(UIButton().rx as Reactive<UIButton>) //Autocompletion will work
Tiphany answered 6/12, 2017 at 11:10 Comment(0)
B
-1

You should import RxSwift ,then command + b

Busman answered 22/11, 2017 at 10:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.