Skip to content

Instantly share code, notes, and snippets.

@n3tr
Last active November 5, 2016 12:14
Show Gist options
  • Save n3tr/b7bf2542c626562a297d71a5fad58ee9 to your computer and use it in GitHub Desktop.
Save n3tr/b7bf2542c626562a297d71a5fad58ee9 to your computer and use it in GitHub Desktop.
dynamic and action handler
// ViewController.swift
class ViewController: NSViewController {
// (1)
dynamic var currentCounter = 0
// ...
// (2)
func increaseCounter() {
currentCounter += 1
}
func decreaseCounter() {
currentCounter -= 1
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment