My app already uses a webview to display a website. I have all that working fine. One problem I do have is that the URL I want to use is actually hard coded into my project. I want the project to read all of the listed URL's in the .txt file and for each of them open them in the Safari View Controller(SVC). Like I said before, I have the app working, even the SVC, just with hard coded URL's in there. I would like it to be able to just know if the URL I clicked on is in the .txt file to open it in SVC not the webview. I saw some examples on how to read files, but nothing that incorporated a webview or SVC.
Asked
Active
Viewed 392 times
1
-
You question is not really clear, but you can just use one of the text tutorials to learn how to load the data in an array, and then check if the url is in the array? – Eric Jul 11 '16 at 15:01
-
@Eric essentially I have a list of URL's in my .txt file that do not work inside of my webview properly. What I want is, when those links are clicked, it opens them in the SVC. However, I can only get my app to open every link in the SVC, not the ones that are listed in the .txt file. – beginnercoder Jul 11 '16 at 15:15
-
Have you found a way to check if an url is inside the text file when the url gets clicked? – Eric Jul 11 '16 at 15:21
-
@Eric No I have not. They are all opening as if they would in the webview, just inside of the SVC instead.I am not even sure if I have the file being read properly – beginnercoder Jul 11 '16 at 15:33
-
Did you figure this out. In my webview the txt file opens in the webview when the link to it is clicked. I need to access the txt file so I can send the data to the server. – wuno Jun 02 '17 at 16:40