Skip to content

Instantly share code, notes, and snippets.

@brianmpalma
Created February 24, 2016 15:49
Show Gist options
  • Save brianmpalma/57177f5df81517c4e7b9 to your computer and use it in GitHub Desktop.
Save brianmpalma/57177f5df81517c4e7b9 to your computer and use it in GitHub Desktop.
extension Bool {
mutating func toggle() {
self = !self
}
}
var isExpanded: Bool = false
isExpanded.toggle()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment