Setup :
I have simple textview added in storyboard based view, with outlet taken in viewcontroller's .m file. I am setting text using it. e.g [_textViewOne setText:@"Test text"];
. I am using Xcode 6.1, compiling with iOS 8.1.
Scenario :
I wanted to make UITextView non touchable, just like UILabel ( i am using UITextView instead of UILabel because my text may be 1 or 2 line and UILabel aligns text at vertically center of view for 1 line and for 2 lines it starts from top left, i want it to start from top left in both cases which is easily achievable by textview ).
To make it non touchable first i disabled selectable
property of it from Storyboard and tried to run application. After unchecking selectable
property my text view's text not using the colour i set for it ( i have set red colour ) and it is using default black colour.
If i check selectable
, text colour follows whatever i set in interface builder.
Issues :
Why unchecking of
selectable
property from interface builder doesn't follow whatever textcolor i set for textview.One more thing i noticed, if i uncheck
selectable
property from interface builder and tried to set it programmatically like_textViewOne.selectable = YES;
then also TextView doesn't follow whatever textcolor i set in interface builder, only checking that property from interface builder works. ( Tried with clean build, restarting xcode also )
( I know i should just make textview's user interaction disabled to make it non touchable, but i accidentally unchecked selectable
and it took my time to figure out what was happening, so just wanted to know was i doing something wrong or this is some kind of issue or this is correct behaviour of this control. )