I have a UITextView in my TV application, when I try to make it focused, then the user interface does not make it focused, and I can not scroll it. I read some questions about this, and some say this is a known issue, and we should use storyboards. I actually use storyboards, but still can't get it to work. I also tried to make it selectable , scrollEnabled and userInteractionEnabled , and then finally tried this line of code, but none of them work.
descriptionLbl.panGestureRecognizer.allowedTouchTypes = [NSNumber(integer: UITouchType.Direct.rawValue)]
I also tried to print bounds abd contentSize UITextView and here is the log
Content Size (740.0, 914.0) Bounds (25.0, 0.0, 740.0, 561.0)
Here is my code can help someone me
@IBOutlet weak var descriptionLbl: UITextView! var currentModel : Model? override func viewDidLoad() { super.viewDidLoad() descriptionLbl.selectable = true descriptionLbl.scrollEnabled = true descriptionLbl.userInteractionEnabled = true descriptionLbl.panGestureRecognizer.allowedTouchTypes = [NSNumber(integer: UITouchType.Direct.rawValue)] descriptionLbl.text = (currentModel?.description)! + (currentModel?.description)! + (currentModel?.description)! descriptionLbl?.contentInset = UIEdgeInsets(top: 0.0, left: -25.0, bottom: 0.0, right: 0.0); }
I think I should not do these many tricks, but it does not work in any way. The focus is actually approaching a UITextView , but it does not scroll. Any ideas?
source share