Questions tagged [uitextviewdelegate]

A text view delegate responds to editing-related messages from the text view. You can use the delegate to track changes to the text itself and to the current selection.

A text view delegate responds to editing-related messages from the text view. You can use the delegate to track changes to the text itself and to the current selection.

@property(nonatomic, assign) id<UITextViewDelegate> delegate

Available in iOS 2.0 and later.

225 questions
1
vote
2 answers

How to update UILabel that is a subview of inputView?

I have UITextView where user types a text. When the keyboard is shown, I add inputView with UIlabel on it. I want this UIlabel to hold character length of the text. It seems very easy task, but unfortunatelly it does not update this word counter…
Tankista
  • 1,685
  • 17
  • 26
1
vote
0 answers

UITextView to detect another developer's app's links

I have a UITextView that I want to be able to recognize another developers app links. The iPhone notepad app detects the link from that developer and when i tap on it notepad opens the other developer's app correctly. but when the same link is in my…
OscarTheGrouch
  • 2,374
  • 4
  • 28
  • 39
1
vote
1 answer

UITextView dynamic height scrolling doesn't work when long text is pasted

I've implemented changing the height of UITextView dynamically when height reaches a certain value by following this solution https://stackoverflow.com/a/38454252/12006517 This works fine however text view freezes when I paste a large chunk of text…
Kamil
  • 49
  • 5
1
vote
2 answers

UITextView searching for keywords in a database

I want to check if the user types specific phrases in a UITextView for a science app. I have this current code that creates a string of the last 20 characters then checks if that string contains a word in the arrayOfWords which gets performed on…
a.wip
  • 69
  • 12
1
vote
4 answers

How to embed UITextView inside UITableViewCell with custom cell that's the delegate?

I've got a UITableViewController with two custom cells - one contains a UITextField (for the user to input a title) and the other contains a UITextView (for the user to input a description). Whenever these change, I want to update my memory object…
ADB
  • 591
  • 7
  • 21
1
vote
1 answer

how to get UItextview touch coordinate position

i need to get the coordinate position from touching a view. The view i touch is UITextview. THe hierarchy of the view is UIViewController -> UITextview. I think i can use locationInView method to get that coordinate. I know that UITextview have some…
R. Dewi
  • 4,141
  • 9
  • 41
  • 66
1
vote
1 answer

How to detect if a link, inside a UITextView inside a TabelCell has been clicked, Swift

My goal is to log all the links that the user clicks on. The links are embedded in a UITextView inside a table cell, and when a user presses the link, I want it to call a function that prints the url. I've looked at similar questions such as How to…
haedaldal
  • 71
  • 10
1
vote
1 answer

UIScrollView scrolling to bottom when UITextField text changes

As it is set up now, I have two UITextViews inside of a UIScrollView. The point of this is that the UITextViews themselves don't scroll, they just get larger (their contentsize) as more text is added. The UIScrollView handles all of the scrolling up…
1
vote
2 answers

How do I call delegate methods for a UITextField within a XIB?

I have a XIB ProfileView contained within a custom UIViewController class Alarm. ProfileView has a subview UITextView, and I want to call UITextView delegate methods from my custom class Alarm instead of ProfileView because all of my logic…
Austin Berenyi
  • 1,013
  • 2
  • 13
  • 25
1
vote
1 answer

How can I hide the keyboard in the UI in Swift Playgrounds (on Xcode) that appears in the Live View when I create a UITextView?

I have created a UITextView object and when I interact with it in the Live View, the keyboard appears in the UI and the only way to enter text seems to be from that keyboard. Is this a recent change in Swift Playgrounds? Is there any way users can…
1
vote
1 answer

Get Number of Lines in UItextView

I am trying to build an app that supports variable size text box depending on the content. The size of the UITextView should increase up to 4 lines and then activate the scrolling. I am not able to get the number of lines when the text is being…
1
vote
1 answer

Allow Action When Tapping UITextView

I would like to be able to effectively use a UITextView as a button in my Swift iOS application. When I tap on the text view, I don't want it to be editable, but I want it to change the background color of the text view and begin using the speech…
1
vote
2 answers

extending UITextView and triggering the delegate for onChange events

This code works and fires: class ViewControllerDisplay: UIViewController, UITextViewDelegate { //..... let textView = MyUITextView(frame: CGRect(x:10, y:20, width:270, height:65)) textView.params["dataname"] = _dataname textView.delegate =…
Mr Heelis
  • 2,370
  • 4
  • 24
  • 34
1
vote
2 answers

How to override UITextViewDelegate function

I would like to make all my UITextViews handle link clicks by opening a web view, rather than opening safari. How can I override this delegate function for all UITextViews within my app: func textView(_ textView: UITextView, shouldInteractWith URL:…
Tometoyou
  • 7,792
  • 12
  • 62
  • 108
1
vote
2 answers

How to set NSAttributedString attributes without invoking textViewDidChangeSelection?

What I'm trying to do: There is an attributed text in UITextView, when user tap somewhere on text (not selecting text, just placing blinking cursor somewhere else) the whole sentence around cursor changes color. How I tried to do this: private…
szooky
  • 177
  • 1
  • 12