how to view selected area source in from UIWebview in iphone SDK? - iphone

iPhone SDK:
Like web-browser does, user select any text area then press right click then select view source. browser will show you selected area source.
Now I want to achieve same functionality in UIWebview ? User open webpage in in-app browser (in UIWebview), user select any text area, i want to get selected text area source, how this can be done in ios sdk ?

Related

How can I detect focus in textfields in a webview using Swift 3?

I am building an application, and when I load a website in webview using Swift 3, the screen will appear like this, now I want to detect when user clicks on the email text field, and add a button to the navigation controller.
I don't know how to do it, does anyone have any idea?
The main use of webview is near like an iframe in web.
I mean that webview is just a displaying of internet content. By this way, you cannot detect any action like user clicks on email textfield.
According to me and currently, there is no possibility to do that because it is not the goal of a webview.

iPhone Message button from a picture in an app?

I would like to implement a feature on my app that when a picture is clicked that it opens up a dialog similar to the dialog opened when you are on a specific picture and you click the icon at the bottom left of the screen. When that is clicked it gives you 7 buttons (Email Photo, Message, Assign to Contact, Use as Wallpaper, Tweet, Print, and Cancel). Would it be possible to do something similar in an app I am developing?
I really would only want the functionality to message and email but mostly just messaging.
thanks
That's a UIActionSheet. To make the picture tap sensitive, you can attach a UIGestureRecognizer to it.

iPhone and iPad wordpress menu BAD behavior

On this site : mecanomedic.com, the menu template work fine in "normal" desktop browser, but dont slide down on ipad-iphone device. What can be the problem ?
Some tell me it's a css problem, but HOW safari desktop work ?
The problem is that the menu expansion relies on the user hovering with a mouse. On touch devices like iPads & iPhones, the hovering gesture can't be replicated because there's only one input- touch. If I were you, I'd take a look at Twitter's Bootstrap menu setup and perhaps use media queries to serve up a different menu on smaller screen sizes.
Here's an example of a Bootstrap navigation bar in action (you'll have to inspect the code to see how it works).
Add a href to the top-level <a>'s so that they can be focusable:
Produits
Elements that are focusable receive mouse events and hover styles when the user taps on them.
As #Matt stated, the problem is that your menu relies on a hover event and unfortunately that event is unavailable on touch screen devices.
One way to fix this would be to:
Check if the current user's device is an iOS device
If the device is an iOS device, use javascript to trigger a menu item's "show event" when the menu button is CLICKED instead of ROLLED OVER / HOVERED.
This would result in the menu being shown when the user taps a menu button.

Preload WebSite

I am using the iPhone simulator that is part of the SDK to test a jQuery Mobile website. I have the startup of the simulator scripted but once the simulator is up and running, I still have to click on Safari/enter the website URL. Is there a way to preload Safari/website URL through the shell script?
You can do the following... Once you open your webpage via mobile safari, look at the bottom tool bar where you see a set of icons. Click on the centre one "Share" and you get a list of options. Select "Add to home screen" and give it a name when prompted. Now, you will have this page added to the home screen and you can simply open this with a click.

In the iOS SDK, how can I include a button in a UITextField like Mobile Safari does?

How can I display a button and/or activity indicator inside of a UITextField on the iPhone? I'm trying to reproduce Mobile Safari's location text field which contains either a reload button or a cancel (stop loading) button which is right-justified inside of the text field.
Similarly, when you click inside of the text field (not on the cancel/reload buttons) to edit the URL, a clear icon (x inside of a circle) is shown inside of the text field which will erase the contents of the text field.
How can I create this in my own apps? I cannot seem to do it via Interface Builder so I suspect it's being done in code.
There is a built in option that worked for me...check here:
Adding the "Clear" Button to an iPhone UITextField
Check out TTMessageController.