How to Identify link attribute range on moving cursor - ios

In UITextView some strings are linkAttributed, How to find the range of all only link attributed string. while editing textview? And Also If user click on back(cross) for removing then can We remove complete link text.

Enable Detection->Links options, the URL and also email will be detected and clickable

Related

Regarding Salesforce merge fields: How can I stop text from wrapping past the original length of the text box, when there is too many characters?

I have a few merge fields on a contract that I want to fit between other words in a paragraph. But when the information from Salesforce is too long for the text box it overlaps the following words in the contract, blocking the signers view of those words. I wanted to know if there is any functionality where the text continues but must be clicked on to view. Sort of like a cell in excel?
Thank You.
If you login to DocuSign and edit your merge field, you can set it to a fixed width under the 'Formatting' section on the right. This should lock the length of the text field, but it won't allow any more text into the field.

Detect link attribute and callout as link for NSAttributedString in iOS

I have a link within an attributed string that is being then set for a textview. For Accessibility purpose, I want that link to be called out as a link trait, is it currently possible for an attributed string to call out different traits within the string? If not what could be an ideal solution to do that then?
You can look for all the "style runs" of attributes within the text view's attributed text by calling attributes(at:longestEffectiveRange:in:) repeatedly until you come to the style run you want. Thus you can locate the link and obtain its value.

Editable, Typable but not removal in pretyped text - Text Field

I want to put some text and display it in a text field. I want the user not to be able to remove this text but only can add some more text to it. Can I do this?
I want to display "http://" prefix in the textfield and the user should be only able to add some more text to this.
this is not possible. I would recomment doing one of the following:
Write the http:// in front of the Textfield
http:// [Textfield]
do some form-validation: does the input submited contain http:// (at the beginning) ? if not add it

iOS: URL link in UITextField with different text

I want to insert a URL hyperlink into a UITextField that has different display text.
This is super easy in html:
Go To Google
How can I do this in iOS?
You can change the text style inside your UITextField via an attributed string sent to the text field's "attributedText" property.
However, what I suspect you really want to do is have a link that's clickable. I would recommend using a UIButton with a custom type (i.e. no border) and you can set the color and the underline style.
But like Evan said, if you have multiple lines of text, it may be smarter to use a UITextField where you set "editable" to NO and turn on the LINK traits (both of these you can do from the object inspector in Xcode).
Alright, so here's what I did to get what I wanted. I used UIWebView, and simply linked it to an html page in the project that has the text, and hyperlink at the bottom with different text displayed.
Answer is here :
If you want it as clickable Hyperlink,
NSString *string = #"Go To Google";
You need to add "BACKWARD SLASH" before ". That's it.

Entering/Clearing specific UITextfields?

My aim is to have text boxes - a set amount per level for people to guess a hidden word. I don't want the UITextfield to be tapped and then bring up the keyboard, I'd like to have a different button that brings up the keyboard - if that's possible.
If each box is a separate text field how could I go about entering text. When a user types on the standard apple keypad, how could each character be inputted into a certain text field. I'd preferably like the text to show in the box as soon as a key is tapped.
I'm also having trouble clearing certain letters. Say a user mis-spells something and doesn't realise until the keyboard has resigned as first responder, how could I make it so that a user can tap on maybe two boxes if the rest of the word is spelt right and the program clear it?
Is there any way of writing the program so that it inputs text only if the text field is empty? Continuing with the example above they switch two letters, they tap to clear, they then bring up the keypad and the next key then pressed fills the empty boxes. Not allowing the program to input text in a used text field that only contains a single character?
I'm using Cocos2d - I don't know if that makes a difference. I hope you understand what I mean, although I'm rather bad at explaining.
Thank you in advance for your time and any help :).
Instead of having a textbox that you don't want users to edit, why not use a label?
To show the keyboard, you need to have it linked to some UITextField (or similar). You could use an invisible UITextField, and then monitor the input and send the characters to the correspinding labels. Refer to this question.
To check if a textfield has anything in it:
[textField.text length] > 0, but I would use labels instead of textfields.
I dont really understand the other parts of your question.

Resources