Skip to content

Instantly share code, notes, and snippets.

@Mreyna3
Last active June 6, 2019 05:41
Show Gist options
  • Save Mreyna3/29ce52b3b301d8e112d0ea3c84f6cd47 to your computer and use it in GitHub Desktop.
Save Mreyna3/29ce52b3b301d8e112d0ea3c84f6cd47 to your computer and use it in GitHub Desktop.
computed property
fileprivate var batchSum : Double!{
willSet{
if (newValue > 0 && newValue > batchSum){
print("\((newValue - batchSum).format()) enqueud into the batch, the updated batch value is: \(newValue!.format())")
}
defaults.set(newValue, forKey: "batch_sum")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment