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

Support namespaces #15

Open
mzaks opened this issue Feb 27, 2016 · 4 comments
Open

Support namespaces #15

mzaks opened this issue Feb 27, 2016 · 4 comments

Comments

@mzaks
Copy link
Owner

mzaks commented Feb 27, 2016

This feature will also make it possible to include all infrastructure code inside the generated file.
This way users don't have to include FlatBuffersSwift module, generating code will be self sufficient.

@hassila
Copy link
Contributor

hassila commented Apr 30, 2016

Shouldn't the reader/builder also be using namespaces in the generated code - seeing them as top level in contactList.swift generated code - would cause trouble if having multiple schemas in the same app?

@hassila
Copy link
Contributor

hassila commented Apr 30, 2016

(specifically, the flatbench now uses the contactList builder&reader instead of the framework one... A bit unexpected.)

@mzaks
Copy link
Owner Author

mzaks commented Apr 30, 2016

Sadly Swift doesn't let me :)
Declaration of protocols typealias and extension has to be on file level and can't be wrapped inside of an enum for example. This way Scalar and Offset has to be outside of the namespace and when generated, it will be duplicated. This is why for now I decided to solve it as described in #23
So as user you can decide if you want to import the lib or include it for the first file and than exclude it for the later once. Not a beauty, but let's see maybe with time we get a better idea, or Swift adds some support for internal protocol definition. Btw. I also added
https://github.com/mzaks/FlatBuffersSwift/blob/master/generate.sh
To being able to generate code before the Performance test build but today at 2 A.M. didn't manage to make XCode execute the shell script.

@hassila
Copy link
Contributor

hassila commented Apr 30, 2016

Ah, I see (not a Swift expert by any means yet). Will ponder if I can think of any better solution for packaging.

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

No branches or pull requests

2 participants