private let startResourceCount = RxSwift.resourceCount
Says,
Module 'RxSwift' has no member named 'resourceCount'
Please take a look on #301
Hi @sergdort I set the OtherSwift Compiler Flags same as you did, still I have same issue, Please see the below SS

Hi @kbala did you make a post POD install hook ?
use_frameworks!
pod 'RxSwift'
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'RxSwift'
target.build_configurations.each do |config|
if config.name == 'Debug'
config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['-D', 'TRACE_RESOURCES']
end
end
end
end
end
I use Carthage build version: github "ReactiveX/RxSwift" ~> 2.0 . And I cann't access RxSwift. resourceCount too.


Here is screen shot from RxExample, looks like it should be -D TRACE_RESOURCES

It seems not working for me.
And it off course should be in the framework build settings. I'm not sure is it possible to do some configurations with Carthage, like with Cocoapods

You can't access resourceCount with Carthage because, as far as I'm aware of, Carthage only uses release version of the binaries, and you can't specify addition compilation flags.
Once any version of RxSwift libraries is compiled without TRACE_RESOURCES Swift flag, the code that traces resources is simply not compiled inside the library.
If Carthage supported specifying additional Swift flags during compilation, that would be possible, but I'm not sure it currently supports that or is there some other way to solve that using Carthage.
@kzaher Yes, Carthage seems can not change build setting.
@sergdort I can not set the build setting of RxSwift framework.
You can use carthage build --configuration Debug.
yes, I run carthage build --configuration Debug
I can access the resourceCount now, and it works :+1:
Thnx @ikesyo :)
And thnx @sergdort , helping with issues helps a lot :+1:
carthage build --platform iOS --configuration Release-Tests
work too
You can also quickly enable RxSwift.resourceCount by adding the TRACE_RESOURCES flag to the RxSwift target, e.g., in the Pods project, Build settings > Other Swift flags > Debug:

You'll just need to remember to re-enable it every time you do a pod update--which, maybe, isn't such a bad thing 馃槈
Just remembering that right now, the resource count is getted from:
RxSwift.Resources.total.
Hey guys you can also add post install to pod file
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'RxSwift'
target.build_configurations.each do |config|
if config.name == 'Debug'
config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['-D', 'TRACE_RESOURCES']
end
end
end
end
end
Let's add this to next release :)
Oh,
@sergdort I've thought we can add this to podspec also and not podfile. My bad.
follow to @kzaher in #1277, i can enable debugging with Carthage by using script:
carthage update --no-use-binaries --configuration Debug RxSwift
I'm having this issue as well even though I am not using Carthage. I added RxSwift to the project with Cocoapods and tried to access RxSwift.Resources.totalCount but after adding the post install script to the podfile I get a dyld: Symbol not found exception on the line RxSwift.Resources.totalCount
What is the correct way to access the total count?
Is there any way to access RxSwift.Resources.totalCount if RxSwift is added via Swift Package Manager?
Is there any way to access
RxSwift.Resources.totalCountif RxSwift is added via Swift Package Manager?
cc @kzaher
@freak4pc @kzaher Sorry) Any updates about Swift package?
Most helpful comment
Hey guys you can also add post install to pod file