How to make an HTML styled-link in IOS? - ios

Target
Give the User a clickable link like they experience and expect from HTML
HTML Example
w3schools - Web Links Example
Question
Is this possible from IOS? I have seen how to -
apply an underline through NSMutableAttributedString
how to open a link through UIApplication.sharedApplication().openURL(NSURL(string: "http://www.google.com")!);
(todo) color
(todo) color toggle
I really hope that this is! It is a strong desire of mine to add to my App right now!

Related

Creating the hyperlink preview in iOS

I am trying to create the preview of a hyperlink. I am unable to get any leads about the same. My project is written in Objective C.
I searched the web and found a few third party libraries which are written in Swift.
Thanks in advance.
To generate a hyperlink preview, make sure the link is either at the beginning of a text message, or at the end of the text message. If the hyperlink is in the middle of the text message, iOS won't show a hyperlink preview. Also make sure that the hyperlink starts with http:// or https://.

IOS: VoiceOver changes to English in WebView

I'm adding VoiceOver support to an app which at the moment only supports Norwegian. For most of the app VoiceOver correctly reads the text as Norwegian.
However, one page contains a webview which shows the terms and conditions (downloaded from a URL). For this page VoiceOver switches to English voice, even though this text is still in Norwegian.
I've tried to set accessibilityLanguage to "nb-NO" for both the webview and the containing viewcontroller but the text is still read as English. Do anyone know how I can make the webview be read in Norwegian?
Consider adopting the lang HTML attribute. This will trigger VoiceOver to generate speech in the appropriate language. Hat tip to Adrian Roselli for the suggestion.
Trying adding HTML lang="" attribute in your page. you can refer below url http://www.iana.org/assignments/language-subtag-registry for more specific value for lang attribute.
Hope this will help

Rich Text Editor for iOS

My users have asked if I can add a Rich Text type editor to my app. The field that they want this added to is a UITextView.
Obviously, they also will want to see the text displayed as they've entered it.
Any suggestions for how to implement this is greatly appreciated.
There are 2 approaches - a UiTexView can handle most Rich Text Editor stuff not including lists.
The 2nd way is a WebView and some html / JavaScript.
A WebView might be the best approach but be careful - some of the WebView based solutions out there were rejected from the AppStore since they use private methods of the WebView - that is not allowed by Apple.

UILabel text as tags and hyperlink

I have a string which I am getting from the server and is dynamic. It is of the format:
<p> John Appleseed Hey http://google.com </p>
Couple of related questions I want to ask in one thread
I want to make the mention text and the URL text to appear in bold and different colour
When URL is tapped it should open a the link in WebView
When the mention text is tapped, it should perform some other action (open User Profile VC)
When tapping mention text, it should send a parameter (uid) to the method, the uid can be extracted from mentions-32 (32 is uid here)
This string can have multiple mentions and links. I am stripping off the HTML tags and I get plain text. I know there is library TTTAttributedLabel which can be used here
Note: This functionality can be compared to what facebook or twitter app does on Newsfeed post text. (Tapping on tag takes the user to User Profile and tapping on the hyperlink opens a webview)
I think the better option to use the GLTapLabel GitHub Demo it is useful for the custom UILabel view controller for iOS that works just like a regular UILabel.
Hope this Demo is helpful u.

Blackberry UI - how to embed link within text

I am making a BlackBerry app, supporting OS 4.5 and later, where I want to embed some links within a line of text on the screen. Like this -
text text text link1 text text link2 text
How do I do it? Tried using 4 seperate ActiveRichTextFields but the problem is how do I make link1 n link2 focus-sable as a word? setChangeListener(this) and setFocusListener(this.getFocusListener()) doesnt seem to do the trick. And how do I capture the click event on the links to redirect it to the webpages?
Take a look at HyperLink example provides By RIM . I think that will surely help you.

Resources