FlatBuffersSwift
FlatBuffersSwift copied to clipboard
Support namespaces
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.
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?
(specifically, the flatbench now uses the contactList builder&reader instead of the framework one... A bit unexpected.)
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.
Ah, I see (not a Swift expert by any means yet). Will ponder if I can think of any better solution for packaging.