mirror of
https://github.com/google/flatbuffers.git
synced 2026-07-03 18:14:13 +00:00
[Swift] Implements FlatbuffersVector which confirms to RandomAccessCollection (#8752)
* Implements FlatbuffersVector in swift Implements FlatbuffersVector which confirms to RandomAccessCollection, this would give us semi-native sugary syntax to all the arrays in swift port. This work will also be the foundation of using arrays in swift * Fix failing tests for Swift
This commit is contained in:
@@ -8,7 +8,7 @@ import Common
|
||||
|
||||
import FlatBuffers
|
||||
|
||||
public enum optional_scalars_OptionalByte: Int8, Enum, Verifiable {
|
||||
public enum optional_scalars_OptionalByte: Int8, FlatbuffersVectorInitializable, Enum, Verifiable {
|
||||
public typealias T = Int8
|
||||
public static var byteSize: Int { return MemoryLayout<Int8>.size }
|
||||
public var value: Int8 { return self.rawValue }
|
||||
@@ -31,7 +31,7 @@ extension optional_scalars_OptionalByte: Encodable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct optional_scalars_ScalarStuff: FlatBufferObject, Verifiable {
|
||||
public struct optional_scalars_ScalarStuff: FlatBufferTable, FlatbuffersVectorInitializable, Verifiable {
|
||||
|
||||
static func validateVersion() { FlatBuffersVersion_25_9_23() }
|
||||
public var __buffer: ByteBuffer! { return _accessor.bb }
|
||||
|
||||
Reference in New Issue
Block a user