Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there any way to access RxSwift.Resources.totalCount if RxSwift is added via Swift Package Manager? #2223

Closed
HMWDavid opened this issue Aug 31, 2020 · 6 comments

Comments

@HMWDavid
Copy link

Is there any way to access RxSwift.Resources.totalCount if RxSwift is added via Swift Package Manager?

Originally posted by @haider-kazal in #378 (comment)

@freak4pc
Copy link
Member

freak4pc commented Aug 31, 2020

Hey, first of all SPM is still riddled with issues in regards to RxSwift and similar inter-module dependency related frameworks (See https://bugs.swift.org/browse/SR-12303)

About your specific question. If you use a Package.swift file, I believe you can do something like this

import PackageDescription

let package = Package(
    name: "Foo",
    targets: [
        .target(
            name: "MyApp",
            cSettings: [
                .define("TRACE_RESOURCES", configuration: .debug)
            ]
        )
    ]
    ... etc etc
)

I'm not sure if you can do it via Xcode, but it is regardless a SwiftPM issue and not a RxSwift issue so I suggest filing a Feedback Feature Request or Bug Report.

@realityworks
Copy link

How is this closed? You cannot change these files from xcode, they are in derived data... Can someone please re-open this.

@freak4pc
Copy link
Member

My comment is quite clear. We support RxSwift, not SPM.

If you try the solution I suggested and it doesn't work, I suggest looking into support related to SPM, as it's not related to RxSwift at all.

@freemansion
Copy link

freemansion commented Oct 18, 2021

Completely agree that access problem is SPM problem. So I would appreciate if someone post a comment with the link with working solution here.

@freak4pc
Copy link
Member

Hey both. The solution I posted above should work, I'm not sure if it's cSettings or cxxSettings but that should be the official way to go.

@cloverdaniel
Copy link

I got this to work with swiftSettings, thusly:

...
targets: [
        .target(
            name: "<target_name>",
            dependencies: ["RxSwift"],
            swiftSettings: [.define("TRACE_RESOURCES", .when(configuration: .debug))]),
    ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants