Skip to content

Instantly share code, notes, and snippets.

@natebirkholz
Created August 9, 2021 16:00
Show Gist options
  • Save natebirkholz/6057365ceec2b03dda5e4570eaa20711 to your computer and use it in GitHub Desktop.
Save natebirkholz/6057365ceec2b03dda5e4570eaa20711 to your computer and use it in GitHub Desktop.
let closure: () -> () = {
print("In Closure!")
}
let button = ClosureButton(frame: CGRect(x: 10, y: 10, width: 100, height: 20))
button.setTitle("Closure", for: .normal)
button.sizeToFit()
button.addClosureForEvent(.touchUpInside, closure: closure)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment