Beyond JSON
@iceX33
What was the most
discussed topic of Swift
community?
JSON parsing!
What if I tell you there is
another way?
Meet FlatBuffers
It was originally created at Google
for game development and other
performance-critical applications.
FlatBuffers
is an efficient cross platform
serialization library for C++, Java,
C#, Go, Python and JavaScript (C,
PHP & Ruby in progress).
FlatBuffersSwift
What is so good about
FlatBuffers?
There is no parsing
involved!!!
Reading data can be done lazy
(almost zero cost)
It's backwards and
forwards compatible
new code can read old data
&
old code can read new data
It's not human readable
And it's a good thing!
(Easy to encrypt and to compress)
{
"name": "maxim",
"age" : 34
}
12, 0, 0, 0,
8, 0,
12, 0,
4, 0,
8, 0,
8, 0, 0, 0,
8, 0, 0, 0,
34, 0, 0, 0,
5, 0, 0, 0,
109, 97, 120, 105, 109
FlatBuffers Swift has a really nice API:
let person = Person(name: "maxim", age: 34)
person.toByteArray
FlatBuffers Swift has a really nice API:
let person = Person.LazyAccess(data: fbData)
let age = person.age
If you are interested or
want to get involved?
https://github.com/mzaks/
FlatBuffersSwift
Thank you
@iceX33

Beyond JSON @ dot swift 2016