From 2e9a19673451e1d4c5a3b3a2ebee058fe90f148c Mon Sep 17 00:00:00 2001 From: mustiikhalil Date: Mon, 4 May 2020 20:18:38 +0300 Subject: [PATCH] Updates swift docs for package management (#5883) Small fix for the clear function --- swift/README.md | 4 +++- swift/Sources/FlatBuffers/FlatBufferBuilder.swift | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/swift/README.md b/swift/README.md index cc7efdec4..909638e8a 100644 --- a/swift/README.md +++ b/swift/README.md @@ -1,6 +1,8 @@ FlatBuffers swift can be found in both SPM -`.package(url: "https://github.com/mustiikhalil/flatbuffers.git", .branch("swift"))` +`.package(url: "https://github.com/mustiikhalil/flatbuffers.git", from: "X.Y.Z"),` + +tags are provided in the repository, so you can select according to the version you want. and Cocoapods diff --git a/swift/Sources/FlatBuffers/FlatBufferBuilder.swift b/swift/Sources/FlatBuffers/FlatBufferBuilder.swift index 62b5260b1..86dfb7647 100644 --- a/swift/Sources/FlatBuffers/FlatBufferBuilder.swift +++ b/swift/Sources/FlatBuffers/FlatBufferBuilder.swift @@ -75,8 +75,10 @@ public struct FlatBufferBuilder { mutating public func clear() { _minAlignment = 0 isNested = false - _bb.clear() stringOffsetMap = [:] + _vtable = [] + _vtables = [] + _bb.clear() } /// Removes all the offsets from the VTable