Reputation:
I have a UILabel
, and what I want is that when a user clicks that UILabel
then the UIDatePicker
would open.
Any idea how to do this?
Upvotes: 0
Views: 982
Reputation: 898
use should use UITapGestureRecognizer
to create tap event in UILabel
Upvotes: 1
Reputation: 3054
Here is something from stackoverflow itself.
Upvotes: 0
Reputation: 1102
In the identity inspector, try to change the default class to UIControl class, that would allow you to add IBActions to your label. But a better way will be to use a textField instead of a label and put a background image and set its border to none from the attributes inspector. i hope it helps, Cheers!!
Upvotes: 0
Reputation: 3908
Yes you need to drop a custom UIButton with clear background on your label with same frame size then connect button with action to open date picker
Upvotes: 0
Reputation: 20021
Many ways to achieve
Upvotes: 0