I set a custom button that executes a goBack method of uiwebview. However, I need then to get destination url when this button is pressed. How could I acces to first position of navigation history? Thank you
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Implement
-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationTypeand store the URL from the NSURLRequest in an instance variable. Then simply access this variable in your goBack method. If you’re multiple navigation steps in, use an array to store each subsequent request and then just access the object at index 0 to get the original URL.