Questions tagged [uitextview]

The UITextView class implements the behavior for a scrollable, multiline text region in iOS. The class supports the display of text using a custom font, color, and alignment and also supports text editing. You typically use a text view to display multiple lines of text, such as when displaying the body of a large text document.

The UITextView class implements the behavior for a scrollable, multiline text region. The class supports the display of text using custom style information and also supports text editing. You typically use a text view to display multiple lines of text, such as when displaying the body of a large text document.

Before iOS 6 () the text could only be styled as a whole, since then the view supports finer grained control of the text style through the .attributedText property.

References:

UITextView Class Reference

5806 questions
2
votes
0 answers

How to increase the UICollectionView cell size while typing in textview (that is inside the cell)?

There is a textview in UICollectionView cell. I want the Cell to increase it's size while user is typing in it. I tried setting estimatedSize to automatic size. Constraints are pinned to top/bottom/left/right and no height constraint. Textview is…
coolly
  • 343
  • 1
  • 6
  • 16
2
votes
2 answers

Achieving dynamically growing TextView inside UITableView

I am working on fitting a UITextView inside a UITableView. My table is grouped style with only one section and one row. I've looked through various previous questions but I am unable to get this idea working. I want the result to be the same as the…
Bourne
  • 10,094
  • 5
  • 24
  • 51
2
votes
2 answers

Accessibility accessibilityDecrement() not getting called

Why are not accessibilityDecrement() and accessibilityIncrement() getting called in my custom UITextView when performing the appropriate gestures? class CustomTextView: UITextView { required init?(coder aDecoder: NSCoder) { …
Melodius
  • 2,505
  • 3
  • 22
  • 37
2
votes
1 answer

Initializing UITextView in a thread -- Causing issue

When I am trying to execute in a thread: UITextView *aDescriptionView = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, 25, 50)]; I am getting this error: bool _WebTryThreadLock(bool), 0x2819b0: Tried to obtain the web lock from a thread other…
Abhinav
  • 37,684
  • 43
  • 191
  • 309
2
votes
2 answers

How to solve "auto-scroll" in UITextView?

I have written a functionscrollToVisible() to scroll text in UItextview because some part of text is covered by the keyboard, or the cursor isn't in visible. But UItextview can scroll the text automatically when the cursor is not in the whole view…
cloxnu
  • 187
  • 1
  • 13
2
votes
2 answers

Have any function to know that I click the keyboard delete button in the UITextView by Swift

As my question title, I want to know the user click the delete button like following image. Thanks. func textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool { if text == "" { …
Beginnerrrrrr
  • 537
  • 1
  • 8
  • 27
2
votes
1 answer

Hashtags in Arabic language crashes the app

I have a hashtags resolver UITextView extension that turns any word with "#" before it to a tappable blue link. It is working fine except when tapping on Arabic hashtags. extension UITextView { func resolveHashAndMentionTags(){ // turn string…
Kegham K.
  • 1,589
  • 22
  • 40
2
votes
3 answers

Swift switch char{ case "\u{e2}:

let splitLines = line.split(separator: "\u{e2}") case "\u{e2}": print("FoundBadReturn") let newText = text.replacingOccurrences(of: "\u{e2}", with: "\n") I'm working with a RTF Document in UITextView. I'm trying to change Strings…
2
votes
0 answers

NSTextAttachment makes textview fonts size smaller

I got an attributed string inside a textview, the image is displaying fine. However, when i add the image to the textview the original font of the textview gets smaller. I would like the fonts to stay the same after the image is added. I dont what…
Iam Wayne
  • 561
  • 6
  • 26
2
votes
0 answers

Keyboard for UITextView

To inherit style for all textViews in my app I did UITextView.appearance().keyboardAppearance = .dark The problem is when I enter the screen with textView my application quits unexpectedly, in log I see: *** Assertion failure in void…
Alexandr Kolesnik
  • 1,929
  • 1
  • 17
  • 30
2
votes
1 answer

How to lock caret y position in UITextView to create typewriter effect?

I'm trying to force UITextView to keep caret always on the same fixed height, for example in the 1/4 of screen. I should behave similar to old typewriters - when user presses enter (or reaches end of line) text should scroll one line up and caret…
szooky
  • 177
  • 1
  • 12
2
votes
1 answer

NSAttributedString has no member replacingOccurrences error

This is my code class AmDocViewController: UIViewController,UITextViewDelegate { var text1:String! let replaceYName: String = "text1" var textA:String! let replaceFName: String = "textA" var textB:String! let…
Sureshtrb
  • 51
  • 11
2
votes
1 answer

UIPickerView - Not working on UITextView TouchUp

I have a form with three UITextView. I want to display a UIPickerView on tap of Text fields. I have written below code for it - @IBAction func selectServiceBook(_ sender: UITextField) { let message = "\n\n\n\n\n\n" let alert =…
Jeet
  • 5,569
  • 8
  • 43
  • 75
2
votes
2 answers

UITextView, sizeToFit doesnt work

I have a uitextview, I would like to dynamically load it based on the contents, the answer from this link doesnt work on iOS11. https://stackoverflow.com/a/20999067/365384 CGFloat fixedWidth = textView.frame.size.width; CGSize newSize =…
bitma
  • 117
  • 1
  • 15
2
votes
0 answers

Swift 4 UiTextView - delete a word inside textView on button click

Is there a way to delete a specific word inside a UITextView? let's say for example that in a textView the user wrote: "Hello my nome is john". As soon as he finished typing he noticed that he mistyped a word. Lets' say that there is an array…
Marco
  • 1,051
  • 1
  • 17
  • 40
1 2 3
99
100