I have an HTML file that’s loaded from a UIWebView. I’m looking to do the opposite – link from the HTML file to a different view controller. How would one go about doing this?
the html file is a local file within the app.
thanks for any help.
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.
You can do this by adopting
UIWebViewDelegateprotocol and implement thewebView:shouldStartLoadWithRequest:navigationType:method. Here you can capture all requests and selectively use them for your purpose.Define links such as
yourapp://yourviewcontroller/argumentwithin the HTML page and parse them in the above mentioned delegate method and load the appropriate view controller.