Skip to content

Instantly share code, notes, and snippets.

@kateinoigakukun
Created April 2, 2017 10:59
Show Gist options
  • Save kateinoigakukun/5caf295caa6844fc85cd46386210c421 to your computer and use it in GitHub Desktop.
Save kateinoigakukun/5caf295caa6844fc85cd46386210c421 to your computer and use it in GitHub Desktop.
Protobufで生成されるコード、セッター部分微妙じゃないですか? #CodePiece
public var optionalValue:SomeObject! {
get {
return builderResult.optionalValue
}
set (value) {
builderResult.hasOptionalValue = true //nilの場合でもtrueに
builderResult.optionalValue = value
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment