Search code examples
iphoneuitextview

How to make UITextView not editable and dont want keyboard to showup


In a UITextView have a text which is for readonly and dont want any userinteraction at all means dont want text to be edited and even dont want keyboard to showup. I want to make UITextView scrollable.

Right now what happening is that it is not scrollable and the content is editable and keyboard shows up and bottom wall of the border is not showing. If anyone can help me with this issue. Will appreciate it so much.

Thanks in advance.


Solution

  • Set the editable / isEditable property to NO / false.

    Swift 3, 4:

    textView.isEditable = false
    

    Swift 1, 2:

    textView.editable = false
    

    Objective-C:

    textView.editable = NO;