Skip to content

Instantly share code, notes, and snippets.

@vikingosegundo
Created March 26, 2022 18:17
Show Gist options
  • Save vikingosegundo/59f44aebc253e20e994b6321b298dcb6 to your computer and use it in GitHub Desktop.
Save vikingosegundo/59f44aebc253e20e994b6321b298dcb6 to your computer and use it in GitHub Desktop.
let s:_Stack<String> = createStack()
s.push("one")
s.push("two")
s.push("three")
let o = Stack(s)
o.push("four")
let t = Stack.Transcoder(stack: o)
let jsonData = try! JSONEncoder().encode(t)
let o2 = (try! JSONDecoder().decode(Stack<String>.Transcoder.self, from: jsonData)).stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment