I want to create a text display area (either UILabel or UITextView) in my iPhone app which (1) allows scrolling and (2) does not allow selection. I have tried the following techniques unsuccessfully:
- Basic UILabel: Didn't allow scrolling, and clipped text to the bottom of UILabel space on screen.
- Giant UILabel within a UIScrollView: the UILabel kept placing the text (vertically) at the center of the giant UILabel, so it often was outside of my UIScrollView.
- UITextView: So far this approach has worked the best, because it scrolls and does not clip the text. I can even subclass UITextView to enable resizing the text to fit within the textview, and passing any touch events to the superview to detect taps & swipes. But, when the user taps and holds on the text itself, the text selection interface appears. I am not interested in this interface and it actually is distracting from the user's experience. I have tried to subclass
canPerformAction:withSender:
, but apparently this function is called after the tap event--not before it.
Does anyone know how to disable the text selection interface in UITextView, without also disabling scrolling?