0

This SO answer shows how to pass multiple UIControlEvents in Objective-C, but how do you do the same in Swift?

The following attempts generate errors:

upButton.addTarget(self, action: #selector(endVerticalButtonTouch), forControlEvents: .TouchUpInside | .TouchUpOutside)

upButton.addTarget(self, action: #selector(endVerticalButtonTouch), forControlEvents: (.TouchUpInside | .TouchUpOutside))

upButton.addTarget(self, action: #selector(endVerticalButtonTouch), forControlEvents: [.TouchUpInside | .TouchUpOutside])
Community
  • 1
  • 1
Crashalot
  • 33,605
  • 61
  • 269
  • 439

0 Answers0