ios - how to show popup from Web-view in Objective c -


i getting data url . showing in web-view fine,but requirement want add references functionality wikipedia shown in image . in wikipedia when click tag scroll down position requirement when user click on reference want show popup . possible?

enter image description here

thanks in advance.

you can make use of uiwebviewdelegate method

- (bool)webview:(uiwebview *)webview shouldstartloadwithrequest:(nsurlrequest *)request navigationtype:(uiwebviewnavigationtype)navigationtype 

this called before web view begins loading.

here argument uiwebviewnavigationtype enum, holds value of navigation type, check whether navigationtype uiwebviewnavigationtypelinkclicked. if yes means webview loading page because of of link clicked.

code this

- (bool)webview:(uiwebview *)webview shouldstartloadwithrequest:(nsurlrequest *)request navigationtype:(uiwebviewnavigationtype)navigationtype {     if (navigationtype == uiwebviewnavigationtypelinkclicked)     {         uialertview *alert = [[uialertview alloc] initwithtitle:@"url" message:[[request url] absolutestring] delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil, nil];         [alert show];     }     return yes; } 

hope helps you.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -