Skip to content

Instantly share code, notes, and snippets.

@BeauNouvelle
Created January 19, 2018 01:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BeauNouvelle/559b0f3f6f6d7780f1bdc8b7cb74e2e6 to your computer and use it in GitHub Desktop.
Save BeauNouvelle/559b0f3f6f6d7780f1bdc8b7cb74e2e6 to your computer and use it in GitHub Desktop.
// Old way of doing things.
let actionButton = UIBarButtonItem(title: "Done", style: .done, target: self, action: #selector(someMethod()))
// New way of doing things.
let button = UIBarButtonItem(title: "Done", style: .done) { _ in
// Do stuff here.
}
@alejojperez
Copy link

It does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment