Sunday, September 24, 2017

The UIButton is not responsive

I'm new to swift. My view controller has only one button. I added a target for it to handle the TouchUpInside event. It worked at first, but it became unresponsive after I made some changes to the UI. It was just like a UILabel. No matter how many times i clicked on it, nothing happened.

Then, i figured out that it was just my silly mistake. I changed its height to zero by accident, but the button still appeared in both Interface Builder and simulator. This is why I got confused. Unlike UIButton, UILablel does not appear in the simulator if its height is zero.

No comments:

Post a Comment