add swift flatbuffers
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
@Tutorial(time: 2) {
|
||||
@Intro(title: "Reading ByteBuffers") {
|
||||
After getting our ByteBuffer created, we can now read it.
|
||||
}
|
||||
|
||||
@Section(title: "Reading your first buffer") {
|
||||
@ContentAndMedia {}
|
||||
@Steps {
|
||||
@Step {
|
||||
After fetching the data from disk or network you need to access that data, and that can be done.
|
||||
By simply calling `getCheckedRoot`, which checks if the data is valid before enabling you to read from a corrupt buffer.
|
||||
however, if you are sure that the data is 100% correct you can simply call `getRoot`
|
||||
@Code(name: "ViewController.swift", file: "swift_code_11.swift")
|
||||
}
|
||||
@Step {
|
||||
Now since we have a Monster object, all the fields can be accessed by simply fetching the data. Note, Deprecated fields will not
|
||||
show up
|
||||
@Code(name: "ViewController.swift", file: "swift_code_12.swift")
|
||||
}
|
||||
@Step {
|
||||
And you can access union types as easy as this
|
||||
@Code(name: "ViewController.swift", file: "swift_code_13.swift")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user