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

Missing required module 'COpenCombineHelpers' #94

Closed
fotiDim opened this issue Oct 26, 2019 · 5 comments
Closed

Missing required module 'COpenCombineHelpers' #94

fotiDim opened this issue Oct 26, 2019 · 5 comments
Assignees

Comments

@fotiDim
Copy link

fotiDim commented Oct 26, 2019

The moment I do "import OpenCombine" I am getting this error Missing required module 'COpenCombineHelpers'. Is there something additional to be done?

@broadwaylamb
Copy link
Member

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!

@broadwaylamb broadwaylamb added the bug Something isn't working label Oct 26, 2019
@broadwaylamb broadwaylamb self-assigned this Oct 26, 2019
@fotiDim
Copy link
Author

fotiDim commented Oct 26, 2019

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 = ""

@broadwaylamb
Copy link
Member

broadwaylamb commented Oct 26, 2019

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.

@fotiDim
Copy link
Author

fotiDim commented Oct 26, 2019

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

@broadwaylamb
Copy link
Member

broadwaylamb commented Oct 26, 2019

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

@broadwaylamb broadwaylamb removed the bug Something isn't working label Oct 28, 2019
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

2 participants