I want to open my UIImagePickerController
when user taps on file input field in UIWebView
. Currently UIWebView
opens its own UIIMagePickerController
on which I don't have any control.
Asked
Active
Viewed 859 times
0

Andy Obusek
- 12,614
- 4
- 41
- 62

Rahul Dange
- 131
- 6
-
Add keyboard hide and show notification. – Rajneesh071 Dec 20 '13 at 14:01
1 Answers
0
One way to do it would be to change the url when the user taps on the file input field. There's an answer about doing something similar here: Is it possible to update a url link based on user text input?
Then your UIWebView
will need to catch that url change and open your UIImagePickerController
. That can easily be done with this chunk of code:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
NSString *URLString = [[request URL] absoluteString];
if ([URLString isEqualToString:@"http://www.mywebsite.com/selectpic.htm"])
{
// Your UIImagePickerController code here
}
return YES;
}