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

'BinanceAllPricesRequest' initializer is inaccessible due to 'internal' protection level #3

Open
alexflm opened this issue Sep 2, 2018 · 5 comments

Comments

@alexflm
Copy link

alexflm commented Sep 2, 2018

Hello! I want to use BinanceApi for the macOS application.
I'll try the examples that are given in README.md, when I use the code from the example (I get the latest price for all symbols), I get an error when I initialize the class
let request = BinanceAllPricesRequest ()

@dpyro
Copy link
Owner

dpyro commented Sep 4, 2018

Which version of Swift are you using?

I released this library when Swift 4.0 was the latest and greatest. Swift minor version increments are not source compatible with previous versions so I suspect there's an issue related to Swift 4.1 or 4.2

@dpyro
Copy link
Owner

dpyro commented Sep 4, 2018

Fixed with 1.0.0! Please see if it works now on your end.

I should make a CI config for this but it's been a late night.

@alexflm
Copy link
Author

alexflm commented Sep 4, 2018

BinanceAllPricesRequest defaults to the internal initializer, so it can not be called from another module. And in the unit tests it works, because it is simulated as a test @testable import BinanceApi. Most likely with other structures the same problem. I think that on real projects this library was not tried even.

@lordAnubis
Copy link

lordAnubis commented Dec 11, 2018

Like AlexeyGorbunov wrote, It ask for a designated init. However If I test with an empty init() then the compiler error goes away but then we get "'elements' is inaccessible due to 'internal' protection level". So this means a full init(...) for each struct.
After some hours I found this reading material "https://docs.swift.org/swift-book/LanguageGuide/AccessControl.html#ID21" - Next time I should read here first.
Please Update it for 4.2 and xcode 9 or/and 10.
Anyhow, thank you for your work.

@lordAnubis
Copy link

lordAnubis commented Dec 11, 2018

BTW, I couldn't compile it using the shell with adding the github dpyro/binance-api in the garthage file. I did compile the two libraries by using the shell separately and the Binance-Api lib using xcode. Otherwise I did get a segment error and xcode crashes. Please also give us a working release setup, because I did get problems there too.

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

3 participants