How to make UILabel
text editable on UILongPressGestureRecognizer
.
So that on long press it converts to editable and after removing focus from uilabel it become readonly.
To change the font or the size of a UILabel in a Storyboard or . XIB file, open it in the interface builder. Select the label and then open up the Attribute Inspector (CMD + Option + 5). Select the button on the font box and then you can change your text size or font.
Set the Boolean variable to false, which enables editing in the text field. When someone taps the Done button, isEditing becomes false. Set the Boolean variable to true, which disables editing in the text field.
A view that displays one or more lines of informational text.
You can't do that. You'd have to exchange controls between UILabel
and UITextField
or make a subclass of UIControl
to do that for you.
uilabels are not editable by the user, use textfield instead. You can adjust the properties of the textfield to make it look like a label.
Then simply set the interaction to disabled to simulate a label and add "something" on the area like an invisible view or button or something to detect the longpressgesture in this part. then when it does programatically set the focus to it. when the user pushes return the focus will be lost and it wont it will go back to being a "label"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With