lightweight implementation of textview with links? - iphone

Is there any lightweight implementation of text with links (highlighted text associated with a uri which a user can click on) on ios? Webview would be too complicated. And I don't want to be using three20 either.

You can implement text with link in following way:
1) Just display the text in label.
2) And take one button on label, set it's property as "Custom Button". So that, text will be displayed.
3) Implement click event of button. And open the url which you want to open.
Hope it will be helpful to you.
Let me know in case of any difficulty.

Related

Is NSTextView missing an insert link functionality?

I created an OS X text editor application (with swift) that uses an NSTextView.
When you right click a link in NSTextView you can choose edit and then a panel pops up and enables you to edit the link.
Is there a way to on insert a link in the same way?
I know NSTextView recognizes links automatically but that does not provide the functionality I need. I need the ability to insert link text and link url that are different from one another.
I currently implemented this by letting the user select text and showing a popup (after pressing cmd+K) where he can enter the link. Then I add the link by:
textStorage?.addAttribute(NSLinkAttributeName, value: url, range: range)
This works, but it seems really strange that apple won't implement this kind of basic behavior in an important control as NSTextView.
Am I missing something?

How would I go about detecting links in TTTAttributedLabel?

I have a table view and in some of the cells there are links, I want to be allow the user to click on these links and view them in a webView (which I have already made). I don't want to use the row selection event because there may be more than one link in the cell. I came across TTTAttributedLabel and think it will be ideal. I don't need to add any style to the text in the cell, I only need to detect the links and capture the click event to open up my webview.
Any help would be greatly appreciated.
It looks like you can assign a TTTAttributedLabelDelegate to a TTTAttributedLabel that will get call backs for when a user selects different link types, but no opportunity for you to capture them and open your own web view (which I think is what you're trying to accomplish).
Instead, you might wanna check out OHAttributedLabel. It's similar in functionality, but when a user clicks on one of the links in the label, it calls -(BOOL)attributedLabel:(OHAttributedLabel*)attributedLabel shouldFollowLink:(NSTextCheckingResult*)linkInfo on it's OHAttributedLabelDelegate, which gives you the opportunity to handle the link tap yourself if you return NO.

Make clickable text to another UIViewController

I have a block of text shown like:
What I am trying to accomplish is that when I add the test to this table view cell, I want to make a specific word or group of words clickable. Lets take the group of words Grand Turk Lighthouse for example. Is there a way to add a href to the word that when I click it, it will send me to say View2 which is in the app. I am building an app that will not go to the internet and so I want a way for the link to be clickable to send to another page within the app. Thanks for any help provided.
I can't give you specific answer, but you may try this :
https://github.com/AliSoftware/OHAttributedLabel
it also could give different style, color, and href in one label.
another alternative, is to use UIWebView, and listen / delegate to it. load html within the app.
hope it helps.

iphone, how to create Combobox like in this image (Birthday combo box)

How can i display combo box like the one you see in the image (Birthday combobox) on this site:
http://www.edumobile.org/iphone/iphone-programming-tutorials/how-to-use-picker-in-iphone/
Is it UITextField or UIButton... How can i create such control?
I think it's a custom button with image that looks like combobox. pressing it opens probably a date picker. You need an image that looks like combobox and to customize your table cell appearance - add a button as accessory view or create a custom cell in IB
You are referring to the screenshot at the top of the article ?
To me it looks like the app is either a WebView or has manually created button image ... to my knowledge there is no native Combo buttons in the UIKit.
Sorry to share the bad news.
Good Luck

iPhone Cocoa hyperlink

is there a way to display a hyperlink in an iPhone native app. Is this done with a label or another UI object?
Thanks!
Joe
Take a look at Three20 TTStyledText class
Create a custom UIButton with only text (no background image) and write an IBAction on its click - you have a hyperlink...
You can embed your text along with hyper link mark ups in a uiwebview object via a static HTML file. Another way is to show the link text on a uibutton and upon click of that button open safari to navigate to the link
I suggest the following solution: Display the htperlink text as a label and put a detailed disclusure button after it. (Detailed disclosure button is an arrowhead in a circle (>). Set the button title to the url, and make an IBAction that handle the click of the button. In this action you can create a new UIWebView, display it and load the URL into it.
There is actually built-in support for this with a UITextView. Check out the accepted answer to this stackoverflow question: How to add hyperlink in iPhone app?