Carlo
Carlo

Reputation: 835

UIButton Touch Event - Swift

My buttons often do not notice the touch. Some causes?

let button = UIButton(type: .system)
button.translatesAutoresizingMaskIntoConstraints = false

Upvotes: 0

Views: 376

Answers (1)

Sonia P
Sonia P

Reputation: 59

Set the translatesAutoresizingMaskIntoConstraints property of the button to be true: button.translatesAutoresizingMaskIntoConstraints = true

Upvotes: 1

Related Questions