Code Monkey home page Code Monkey logo

Comments (5)

fotiDim avatar fotiDim commented on May 18, 2024 1

Yes Swift Package Manager. I tried 0.4 and 0.5. I got around the error by adding "OpenCombine" under "Frameworks and Libraries". However now I ran into the next error which is Unknown attribute 'Published' when I do @Published private var searchText: String = ""

from opencombine.

broadwaylamb avatar broadwaylamb commented on May 18, 2024 1

It is a good idea to put that in the Readme. I had no idea what OpenCombineDispatch is and if it was needed.

I'll definitely do. OpenCombineDispatch extends the DispatchQueue class and adds conformance to the Scheduler protocol. It is extracted into a different target because OpenCombine (just like Combine) doesn't depend on Dispatch, or Foundation, or anything like that. So if you don't need that conformance, you are free to exclude that target. But you probably do.

Regarding iOS 13+ does the library fall back to Apple's Combine or still uses the OpenCombine implementation? Would something like that work?

Frankly, I'm not sure it is possible to fallback to Combine on iOS 13+. The reason for that is that would require runtime checks like if #available(iOS 13.0), rather then compile-time checks like in your example. And those runtime checks would require a whole lot of complexity and would likely cause performance regressions.

So, answering to your question, even on iOS 13+ OpenCombine implementation is used, and there's not really anything we can do about it right now :(

from opencombine.

broadwaylamb avatar broadwaylamb commented on May 18, 2024

Hello! No, everything should just work.

What is your setup? Are you using the library as a Swift Package Manager dependency, and what version?

I'd really like to help you with this, so any details about how to reproduce the issue would be much appreciated!

from opencombine.

broadwaylamb avatar broadwaylamb commented on May 18, 2024

I got around the error by adding "OpenCombine" under "Frameworks and Libraries".

Well, yes, that needs to be done. When you add a Swift package as a dependency, Xcode suggests you a list of the package targets with checkboxes. Activating those checkboxes basically adds the target to "Frameworks and Libraries":

Screenshot 2019-10-26 at 13 58 24

However now I ran into the next error which is Unknown attribute 'Published' when I do @Published private var searchText: String = ""

Oh, Published.

Published doesn't work yet, unfortunately. Believe it or not, I'm coding it right at this moment, so expect it to be ready in the next version.

The error you get, however, can probably be fixed by writing @OpenCombine.Published. Why? Because Foundation re-exports Published from Combine, so there can be a name collision if both Foundation and OpenCombine are imported.

from opencombine.

fotiDim avatar fotiDim commented on May 18, 2024

I see. It is a good idea to put that in the Readme. I had no idea what OpenCombineDispatch is and if it was needed.

I see. Regarding iOS 13+ does the library fall back to Apple's Combine or still uses the OpenCombine implementation? Would something like that work?

#if canImport(Combine)
import Combine
#else
import OpenCombine
#endif

from opencombine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.