AppCode doesn't prompt RxSwift classes and some other installed CocoaPods - ios

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?

You need to wait for this problem to be fixed, sorry for that.
UPD: fixed in 2018.1 EAP, see here

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 :)

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

You should import RxSwift ,then command + b

Related

Issues making a wrapper Swift Package for Tidy-HTML5

So I'm trying to include Tidy-HTML5 into an app I'm making. I've run into some issue lately that I don't really know how to solve.
I created this wrapper package, since Tidy-HTML5 is a pure C library and does not support Swift Package Manager.
When I add this package as a dependency in my main project it works fine. That is I need to do the following:
import SwiftTidyHTML
import tidy
But this only works if I build for macOS, if I build for iOS I get an error that tidy cannot be found.
Any help would be really appreciated.
Thanks in advance.

Cannot find protocol declaration for *** in my 'MyApp-Swift.h'

I am working on a project that up to now, despite the mess, it was working ok. Today, believe it or not, I have been updating it to Swift 5.
The project has iOS and tvOS targets as well as frameworks, tests, and top selves extensions. The project also was started using Objective-C and over the years has become 90% Swift.
I am not sure at what point something went wrong but, when compiling, I get the following error for all my top self extensions (mostly all tvOS Targets).
I have found similar questions but I can't understand whats going on.
Any ideas?
You are probably missing an import StoreKit in the Swift files that define IAPHelper. Sometimes this gets imported transitively, and Swift doesn't necessarily need it, but the Swift bridging header does.
Ultimately you need to make sure there's an ObjC #import StoreKit; that is evaluated before this line of code.
First, I have to thank Rob for his tips. I wish he could get the points!
After troubleshooting with the tips provided:
Add StoreKit to your linked frameworks list. -> Didn't work
#import StoreKit; before #import <...-Swift.h> -> Showed error use of #import when modules are disabled
I also saw that "...-Swift.h" was only declared in the Build settings of my "...Topself" targets. Still quite unsure why as I would have thought the whole project still have ObjC dependencies... Still quite new to this challenge.
Furthermore, If I unfold the error I could see that there was some kind of error trying to find "...-Swift.h" file.
At this point, I remembered that I am using cocoapods (I don't like you, you don't like me relationship) and I hated to see the warning "...Overrides Enable modules (C - Objective-C)" so I set it to default for the whole project.
Turns out that that for all "...TopSelf" targets, the default value is NO.
By Overriding Enable modules (C - Objective-C) to YES, clean, and build, everything started working again.

How to fix "No such module 'FirebaseDatabaseUI'" in Swift 4?

I installed FirebaseDatabaseUI via Cocoapods, closed the .xcodeproj then opened the .xcodeworkspace, but whenever I try to import it within my code, it keeps saying No such module 'FirebaseDatabaseUI'
Supposing it might be a dependency issue, I decided to install the FirebaseUI full bundle by pod 'FirebaseUI', but achieved no success at all. As can be seen in the screenshot I took of my code, FirebaseDatabaseUI is the only FirebaseUI library in which is occurring the issue.
Can someone tell me what might be wrong?
Actually, all subspec like Database, Firestore, Auth... is implicitly belong to FirebaseUI. You saw only FirebaseDatabaseUI get error warning because you put it in the first place, if you put other FirebaseXYZUI to the first place, it will also display that error.
To fix the error, simply import FirebaseUI and remove all other FirebaseXYZUI.
Hope this helps.

iOS: #import AnyModule not found after editing class using cocoapods

I have an Obj-C/Swift project setup that imports modules using cocoapods. In any class where I am importing a framework using the #import function I get the error message SomeModule not found. However, when I build/run it compiles fine, and the framework works and functions as expected.
The problem here is that it messes me up when I'm trying to write code below the error (i.e., objects appear as ints because the error above messes up the compiler; function auto complete doesn't work, etc). What's weird, if I cmd+s to save the class, the error messages go away. Then the second I start typing again, they reappear.
I've gone as far as removing all of my cocoapods and reinstalling them, but to no avail. This has only been an issue since installing xcode 8.
Anyone have any insight into this?
Thanks in advance.
Sorry for super late response - the only way I found to get around this was to use the "old" style of framework import; i.e., ... it seems like some Frameworks just don't play nicely with the #import declaration. #pablo-martinez
If someone has a better solution please feel free to share.

Can't see debug info Xcode 6.4?

I think I've accidentally removed some kind of setting or something on a project level. In project A I can see debug info, but in project B I can't see a damn thing while debugging. Local variables can't be expanded to see what they contain, and neither variabels located in self.
As stated earlier, it works fine in one project, but not at all in another. I have no idea what I've done, or how to solve it. I asked around with a few coworkers and none has experienced this before. Kind of need to fix this in order to work efficiently.
Here is a screenshot displaying what I mean:
I don't have any variables in self here, but if I add some or store some, it doesn't work anyway. I can't see anything in self since I can't expand it at all.
Help appreciated!
I found the solution for this. Or rather I found the issue. The issue seems to be with either Xcode 6.4 and above, or GoogleMaps in general. When importing GoogleMaps SDK the debugger stops working properly. Simple as that. Comment out your import of GoogleMaps SDK and the debugger will be back to normal.
Another way of solving this is to bridge GoogleMaps SDK from ObjC to Swift rather than importing it in Swift. I didn't try this, but I saw this as a possible solution here: https://code.google.com/p/gmaps-api-issues/issues/detail?id=8524
Hope it helps someone. Took me days to find this information.

Resources