Detect taps of links/numbers in UITextView - iphone-sdk-3.0

theres no way to detect weather the user taped on a phone number and/or link in a UITextView is there?
There doesn't seem to be a delegate method for it.
Any ideas?

You cant with UITextFied, but if you use a webview and get it to load a string with html tags for links, you can use the should load method to detect whats doing.

Related

UISearchBar implementation Like Instagram IOS7

Hello i am trying to implement a uitabbarview defined only for search. Ideally i want to implement the exact same style that instagram does Not the suggestions but the actual search bar and the tab controls to switch between the users and hashtags. I've been researching online and haven't found anyone with my exact problem. Any help would be appreciated. Disregard the device and all and just focus on the searchable with the two segmented tabs. i want something exactly like this and ill handle all the search and results etc.
What you will need to find info on is the UISearchBar and especially the UISearchBar delegate method called shouldChangeTextInRange
Find out more about UISearchBar and its delegate methods here
Helpful tutorial here (Filters the UItableView result as you type)

Make UIWebView part of UITableviewCell

I need to make UI like following:
In response to a HTTPRequest, I am getting JSON response.
Title & Some HTML Content.
I fill UITableViewCell with the title i get in response.
Now, I need to display the HTML Content in a dropdown manner, with UITableViewCell. Means, on tapping on cell It appears below the cell (or say, in the cell) and tapping again will make it disappear.
I am thinking of making UIWebView, a part of UITableViewCell. Any guidance on how to achive that.
And also, Is there any better way to perform this?
As you asked, "And also, Is there any better way to perform this?"
Not better I can say, but
In my case, I did it using different approach.
on didSelectRowAtIndexpath: I set up new UIWebView and showed the HTML content in it.
I really searched the web for setting the height of UIWebView dynamically, as per the content I am getting through WebResponse. But, I didn't found anything useful, really.
You can try dynamically inserting and removing custom cell which holds UIWebView below cell you select on didSelectRowAtIndexPath:. But I strongly suggest you find a way to convert HTML into string (NSAttributedString, for example) and show a label. UIWebView is known for killing performance.

iOS UIWebView intercept link click

Is it possible intercept when a user clicks a link in a UIWebView and retrieve the link?
I wish to block the UIWebView from going to the clicked link and do something else.
Thanks in advance.
Yes, look at the UIWebViewDelegate Protocol Reference, specifically webView:shouldStartLoadWithRequest:navigationType:
The NSURLRequest will let you know where the link they clicked is going to direct them.
You would simply return NO on this method if you want to prevent the request from loading.

XCode 4. Keyboard doesn't hide on iPad

I have a problem with my iPad app.
I perform authorization in social networks (facebook, twitter etc.) to post information from app. Several webviews change each other (login, content of post, captcha). They have text fields and I have to show keyboard. After posting I return to some start view with posted information.
It works good, but after posting first news something goes wrong. When I post news one more time, after return keyboard is still on the screen.
I saw here some questions familiar to this, but they wasn't useful.
I tried to make resignFirstRersponder to all webViews, textFields and textViews. Also i\I tried to implement method disablesAutomaticKeyboardDismissal but it doesn't help me.
I don't know where search for problem...
So questions are: why could this happened? How can I solve this? fnd How can I get some information about keyboard? (is it visible, what object has focus etc., anything that could be useful to solve problem)
And one more thing. I have similar app for iPhone and it seems to work correct.
Try this:
[searchBar performSelector:#selector(resignFirstResponder) withObject:nil afterDelay:0.1];
Make sure to replace searchBar with the object that is the actual First responder in your case
Problem is fixed, finally. The reason was the way I had changed visible view. I set a new value to view property of ViewController. And as previous view contains text field with focus on it, focus wasn't lost before changing view (and keyboard was still on the screen), but I had lost handler to previous view.
Solution is: resignFirstResponder to all (or current) inputs BEFORE changing view.
Hope, it's clear. Thanks for your help!

Why doesn't a tap on UITextField open the keyboard?

I'm very new to Objective-C and Cocoa Touch. I have been following tutorials from a book. Currently I have a UITextField that is supposed to open the keyboard on a tap from the user to enter input.
However, when I run the app, nothing happens when I tap on the text field. I've checked all its attributes and made sure that it's enabled and user interaction is enabled.
Is there something really obvious I'm missing? I've read the tutorial two to three times, and I can't figure out what's wrong.
have you linked everything in interface builder (if you created the textfield by XIB)
Set that textfield as firstresponder. See How do I set the firstresponder?.