225 questions
2
votes
2
answers
227
views
Implementing Undo/Redo Feature in UITextView with IME Support
Currently, we are implementing an undo/redo feature in UITextView.
However, we cannot use the built-in UndoManager in UITextView because we have multiple UITextView instances inside a UICollectionView....
0
votes
0
answers
373
views
Swift UITextView Delegate
I am having a problem and have searched all across StackO and did not see a solution.
I have a UITextview extension with TextViewDelegate that I call inside of my VC so that i can have a placeholder ...
1
vote
0
answers
152
views
Ignore space after predictive text selection in UITextView
I found something similar to my problem checkout here but it does not work for me: link
Thid UITextView delegate method calls twice If we tap on predictive text
1st call insert text 2nd call insert ...
1
vote
1
answer
746
views
Detect shift + return key when UITextView is the responder
I want to detect if the user presses either just "return" key or "shift+return" key on the external keyboard to perform two different actions when the UITextView is the responder.
...
0
votes
1
answer
668
views
Keyboard not appearing in UITextField and UITextView IOS 15
i am not using storyboard for this application so here's my SceneDelegate willConnectTo function
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene....
0
votes
3
answers
1k
views
UITextField shouldChangeCharacters in swift is not working for the first letter entered
I have a textfield population phone number. When i am entering phone number i am checking validation for a invalid phone number. i am using delegate method "textfield should change characters&...
6
votes
2
answers
2k
views
iOS15 UITextView After dragging the view, it causes a crash, Invalid parameter not satisfying: pos
crash example
The above article is a problem found by a netizen on the forum. Recently, I also found a similar crash stack on firebase. I guess it is also caused by this reason, and it may be the ...
0
votes
1
answer
229
views
UITextView shouldInteractWith delegate returning value in alert completion
I have a text view inside a table view cell that can contain URLs. When the user taps on the URL, I want to present an alert to ensure the user wants to continue before handling the URL. I'm trying to ...
2
votes
1
answer
534
views
how to subscribe to a UITextView in iOS swift?
I am fairly new to IOS development and working on a small project, I am trying to subscribe to UITextView using Rxswift. However, I can't seem to find any way to do so online or by following what I ...
-1
votes
1
answer
191
views
How can I prevent a self-sizing UITextView from growing past a specific point (keyboard top anchor, e.g.)?
I have a UITextView, which automatically grows according to the user's text input.
I'd like to prevent the UITextView's bottom anchor from going under the keyboard, or I'd like to autoscroll the view ...
1
vote
1
answer
2k
views
iOS app crashes when tapping URL within UITextView [duplicate]
I'm trying to setup a UITextView with multiple links within the text. My implementation is based on the suggestion described here. Most links work as expected, however tapping on some of them makes ...
1
vote
1
answer
671
views
What main difference textFieldDidChange and shouldChangeCharactersIn method, the delegate of UITextFieldDelegate?
Can someone explain about when to use and how difference of them ?.
3
votes
1
answer
1k
views
Resizable UITextView Has sizeThatFits That Gives Wrong Size in UIViewRepresentable
I am using a UITextView in a SwiftUI app in order to get a list of editable, multiline text fields based on this answer: How do I create a multiline TextField in SwiftUI?
I use the component in ...
1
vote
1
answer
470
views
Delegate method, textViewDidChangeSelection not triggered everytime
I have a UITextView embedded in a UITableView Cell, CustomCell. If I tap the return key when my curser is at the end of the text, I want to create a new cell below that cell, but if I tap return when ...
1
vote
1
answer
318
views
how to find out the text in UITextview does not required to scroll in iOS
I am showing the terms and conditions in the UITextView. when users reached the last line of the text in the UITextView and then only enabling the button (which navigates to the next screen) available ...
0
votes
4
answers
1k
views
SWIFT iOS - Get text from multi-line uitextview with line breaks as they are visible on the screen
I have a multi-line UITextView and sometimes the text wraps several lines. I want to get the text from it with line breaks from what is visible on the iphone screen.
This is useful because I have a ...
1
vote
2
answers
217
views
Why observer onKeyboardDisplayed is called before textViewDidBeginEditing
My App is in swift. When I edit a UITextField, sometimes the keyboard hides the field. So I use the delegate textFieldDidBeginEditing to set an "activeTextField" (and textFieldDidEndEditing ...
0
votes
0
answers
669
views
NSAttributedString.Key,Link not working on ios 11.4
I have a UITextView that works great in iOS 12 and 13 but not on iOS 11.4 and below.
This textView has a text that 2 parts need to be clickable and open a webview (the common Privacy Policy and Terms &...
3
votes
3
answers
2k
views
UITextView observe text changes
I want to listen for every text change in UITextView. The setup is very trivial.
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
NotificationCenter.default....
0
votes
0
answers
181
views
How to add text bubble styles when I separate the email address by comma as show in the screen shot attached
Hi I'm new to iOS app development. I am implemented an UITextview to add multiple address separated by comma I need to apply a style bubble when user separates the email by pressing comma or space or ...
-1
votes
1
answer
533
views
UITextView User Input Text Validation in Swift 4 or Swift 5: Restrict the specific characters in Swift
Need help on how to do a text input validation to a UITextView. Many help is there for UITextField, but I can't find the right solution for this textView input validation. My expectation is to a ...
0
votes
2
answers
2k
views
Toggle Enabling UITextView Scroll After Max Number of Lines
I have a uitextview subview in an inputContainerView as it may appear in a messaging app.
Programmatically, on load, the height anchor of the uitextview is set when the inputContainerView is ...
3
votes
1
answer
564
views
Delete Slide-to-type by word in UITextView gives incorrect range in `shouldChangeText` delegate method
I have a UITextView in a ViewController. I've implemented shouldChangeTextInRange delegate method from UITextViewDelegate. The range value I obtain through the above delegate method for deleting a ...
-1
votes
1
answer
260
views
What is difference between the return value of the method named "textFieldShouldReturn(textField:)"? [duplicate]
I have doubts when i implement the delegate method textFieldShouldReturn of UITextField, I don't know what's difference between the return value.
I have tried return false and return true in it, but ...
2
votes
1
answer
729
views
Expand UITextView and then scroll after certain point
I have been struggling to set create this, I have read numerous posts on here, but do not understand what I am doing wrong.
I have a UITextView.
I would like it to expand in height, up to a number ...
1
vote
0
answers
33
views
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 ...
0
votes
1
answer
902
views
UITextView delegate shouldChangeTextInRange isn't called when keyboard is selected to Chinese (Simplified) - Handwriting in Swift 4.2
Here is my Sample Code:
class ViewController: UIViewController, UITextViewDelegate {
@IBOutlet weak var textView_editingView: UITextView!
override func viewDidLoad() {
super.viewDidLoad()
...
15
votes
2
answers
4k
views
iOS 13.1 UITextView delegate method shouldInteract called when scrolling on attachment
I'm using the UITextView delegate method to do some custom work like opening a in-app browser when user tapping on URL or attachment:
func textView(_ textView: UITextView,
...
1
vote
1
answer
644
views
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 ...
0
votes
1
answer
86
views
Delegate protocol functions not triggered for UITextView
I have this swift file where I'm trying to create a custom class to handle placeholders for multiple text views on one page. I prefer a separate class because I think its cleaner to handle multiple ...
0
votes
2
answers
2k
views
How can I prevent a user from adding too many line breaks in a UITextView in Swift 5?
I have a UITextView to let users type-in comments for some audio file they have just recorded.
I would like to limit the amount of the "\n" (newline characters) they can use to 5 (i.e., the comment ...
-1
votes
1
answer
831
views
UITextView in UITableViewCell fail to be assigned its delegate for the first time in `textViewDidBeginEditing` method
Original post:
As suggested from the title. I have made sure that when the cell is initiated in the cellForRowAt method, the cell's textview will be assigned a delegate from within the method. In ...
2
votes
2
answers
1k
views
Completely disable 'backspace' being pressed Swift
I'm working on an app where the user needs to be able to type 'forwards' but is not able to delete anything (to go back and edit for example) that has already been typed.
There are a few answers that ...
1
vote
2
answers
156
views
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 ...
3
votes
1
answer
506
views
Detect keyboard combinations that change text
I have a library I’m building that needs to keep track of text entry into a UITextView in order to keep track of positions of certain sections of text. Most cases are handled fine within the textView(...
1
vote
4
answers
2k
views
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 ...
2
votes
3
answers
2k
views
textViewDidBeginEditing on 2 separate textViews in swift
I have 2 separate textViews that I want to trigger an event when each of them are tapped. the termTextView triggers fine, but when termTextView is triggered first, the definitionTextView does not ...
3
votes
0
answers
283
views
Cursor position jumps when typing fast in UITextView
I have UITextView in app, Its used like text editor app.
When typing long text and typing fast textview cursor position behave weird, its jumping like typewriter. You can find GIF from below link.
On ...
0
votes
1
answer
1k
views
How do I implement mention of users after @ (AT) as in Twitter or WhatsApp?
Help me please implement UITextView, which will be able to recognise @.
When I'm typing characters of the username required after @, there is filtered tableView with the username appearing, in which I ...
0
votes
1
answer
266
views
dynamic textview with arabic text entry
I am using a dynamic textview.
func textViewDidChange(_ textView: UITextView) {
let str = textView.text! as NSString
let size = str.size(attributes: [NSFontAttributeName: UIFont....
0
votes
1
answer
992
views
Extra space is added at the bottom of text in uitextview when string is pasted into it
When i am pasting the text in UITextView then some extra space is getting added into it. But when i scroll it then the textView is fitted according to the content. In textViewDidChange, textView ...
1
vote
1
answer
2k
views
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.
...
2
votes
0
answers
431
views
Detecting paste UITextView in textViewDidChange
I am creating a UITextView for use as a rudimentary IDE. When the user pastes text (code) I am modifying it so that it fits inline (correctly indented) with the other text. However, I am also coloring ...
2
votes
0
answers
120
views
Cursor in TextView Too Small Initially?
I have an iOS Application. When the user clicks on a textview, the cursor is very small initially. This is what it looks like:
As soon as the user begins typing, the cursor changes size and becomes ...
-2
votes
4
answers
1k
views
Xcode 9 TextViewShouldReturn [closed]
In the past, to dismiss the keyboard after a user hits return I would simply override the TextViewShouldReturn function. However, upon re-downloading Xcode (version 9.3.1) it seems it is no longer a ...
1
vote
2
answers
568
views
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 ...
0
votes
1
answer
2k
views
TextView Counter On Typing And Count New Line Swift IOS
I want to count newlines ("\n") in a textview.
Or, more specifically, I want to make textview box to count the characters when typing ( +1 ) in label. Also count ( +2 ) when the text have new line ...
1
vote
1
answer
401
views
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 ...
0
votes
1
answer
352
views
NSRegularExpressions performance on UITextView
I'm currently working with NSRegularExpressions (regex), which I'm building a markdown regex.
I think that my approach on the way to change the text that matches the regex isn't the best one, and ...
1
vote
1
answer
2k
views
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 ...