add swift flatbuffers

This commit is contained in:
William Casarin
2023-08-26 20:43:54 -07:00
parent 35b67dc08d
commit 4c0166bd31
47 changed files with 3955 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import FlatBuffers
import Foundation
func run() {
// create a ByteBuffer(:) from an [UInt8] or Data()
let buf = [] // Get your data
var byteBuffer = ByteBuffer(bytes: buf)
// Get an accessor to the root object inside the buffer.
let monster: Monster = try! getCheckedRoot(byteBuffer: &byteBuffer)
// let monster: Monster = getRoot(byteBuffer: &byteBuffer)
}