[swift] Implements union strings (#6589)

This commit is contained in:
mustiikhalil
2021-04-24 14:47:24 +03:00
committed by GitHub
parent b82fe07384
commit 4ccc52c7a0
19 changed files with 398 additions and 282 deletions

View File

@@ -80,12 +80,12 @@ public struct Table {
return r
}
public func union<T: FlatBufferObject>(_ o: Int32) -> T {
public func union<T: FlatbuffersInitializable>(_ o: Int32) -> T {
let o = o + postion
return directUnion(o)
}
public func directUnion<T: FlatBufferObject>(_ o: Int32) -> T {
public func directUnion<T: FlatbuffersInitializable>(_ o: Int32) -> T {
T.init(bb, o: o + bb.read(def: Int32.self, position: Int(o)))
}