Skip to content

Instantly share code, notes, and snippets.

@LucianoPAlmeida
Created November 20, 2019 03:08
Show Gist options
  • Save LucianoPAlmeida/55b0e9c5aea514771290008d2ea6914f to your computer and use it in GitHub Desktop.
Save LucianoPAlmeida/55b0e9c5aea514771290008d2ea6914f to your computer and use it in GitHub Desktop.
struct S1 {
private var _buffer: [UInt8] = []
var values: [UInt8] {
get { _buffer }
_modify {
yield &_buffer
}
}
}
var s1 = S1()
s1.values.append(1)
s1.values.append(2)
print(s1.values)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment