Skip to content

Instantly share code, notes, and snippets.

@regularberry
Created May 29, 2018 20:54
Show Gist options
  • Save regularberry/8f792a85c43bfcd8eca71a4510028bde to your computer and use it in GitHub Desktop.
Save regularberry/8f792a85c43bfcd8eca71a4510028bde to your computer and use it in GitHub Desktop.
class MutableClass {
var val: Int?
init(val: Int = 0) {
self.val = val
}
func update(newVal: Int) {
val = nil
val = newVal
let f = val! + 5
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment