How would I go about detecting links in TTTAttributedLabel? - iphone

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.

Related

Swift- How do I make it so that if the user clicks the button it takes them to a new view?

I'm currently trying to create a small notepad app, and i'm in need of help. I am using a Tabbed View Application. Say we had a view that has two text fields for Name and short description, and then a button beneath saying "Create Note".
How can I make this button change the view to my editor/notepad view that does not have the tabs at the bottom?
Thanks
If you are using storyboards, which I assume that you are, what you will want to use are triggered movements called segues.
To create one, right-click on the button and drag the line that appears to the second view, and then release.
It should look like this:
Then, when you release, a gray box will appear, with a list of segues. You can find out what each one does online, and as you get more advanced you can develop custom ones.
However, use Modal as a basic one to begin with.
Hope this helps,
Will.
PS. In the future, try and make your questions more specific, and do some research before you ask a question. It's important that you gain a good reputation on Stack Overflow if you want your questions answered properly.

Should I provide new GWT place?

I have a general question for GWT Activity and Places paradigm realization
For example, I have a place "productList" and appropriate view ProductListView. A have a table with some Product entity in each row. I wanna to double click on row and got popup window which allow me to edit Product in doubleclicked row. How to implement it? Should I provide new place "editProduct" for this activity?
A popup dialog is not a place - users would not expect to see it when they press the back button. So there is no need to create a special EditProduct place.
You can think of "places" as something that users may want to see when they click on Back or Forward buttons, or something they want to bookmark.

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 Footer like functionality

I am having trouble with designing my App.
I am having a button and a label in every page, required functionality is when user clicks a button, it will fetch the last tweet of application's tweeter account and will display it in label.
I know how to fetch and display it in one page.
My question is, can't I create something like custom control, which i just need to place in every page.
Hope, i was able to explain my question.
Any help will be appreciated.. thanks in advance.
Paresh
you create this footer view and place it in the first view (or a base view) and add all the subsequent views below it.. or you could even add it directly to the window..

Select dropdown list accessibility/usability

I am trying to find the most usable/accessible way to implement a simple form dropdown list which will sort a list of products by pice and alphabetical order.
In your opinion is the dropdown more usable when there is a button that governs its submission or when it automatically submits onchange of the dropdown?
The research I have read is both for and against such methods and there is a variery of implementations on the web so interest to hear the thoughts of the community.
Thanks in advance
As a blind computer user either method works fine. I find that having a button to click is slightly easier for me then the onchange event firing. I wouldn't say it's a big enough difference to take into account though assuming the majority of your users will not be disabled. If your targeting specifically blind users I would not use the onchange event.
So long as you do not change focus or navigate to another page when the selection changes, either approach should work. The classic example of a problem dropdown is where it contains a list of other pages on the site, and navigates as soon as the selection changes. This prevents a keyboard user from using the list; they can't browse it, and can't navigate to any pages beyond the first selection, since it's impossible to navigate past those. So in cases where focus changes or the page navigates as a consequence, having a separate action (eg. Go button, or handling enter) to cause the navigation to take place is essential. This is likely where the advice you've read is coming from.
In this case, however, it sounds as though you are just updating content elsewhere on the page, and not changing focus or doing navigation. Simply resorting existing content should be fine.
Depends on your users and their respective expectations and the context in which it's presented.
As a blanket, general statement, you should have the drop down accompanied by very obvious submission button. That is the safer approach.
If you are refreshing page data or if the focus moves away after the dropdown option is selected, you should use a button to be accessible. If you fire the event on change, blind or keyboard-only users will not be able to use the dropdown menu at all if they are on windows with ie and chrome (so added together, a majority of the people on windows). As soon as they use the arrows to scroll down and make a selection, the first option they hit will be selected and the page data will refresh or the focus will move, making it impossible for them to navigate or select the second option, third option, etc. Below is a thorough explanation with examples so you can see what I mean.
Designers definitely don't like the buttons, but if you are blind and on chrome/ie, it is impossible to use a lot of dropdowns without it. I'm guessing Jared uses firefox or a mac.
http://pauljadam.com/blog/javascript/onchange-event-on-a-select-inputjump-menu-accessibility-problems/