iOs Web view how to make static a dynamic page - ios

I have an iOs web View App wich connect to a touch responsive website and I would like to do some tabs in the app, one for contact form, another one for "about us", something like that...
The problem is you can navigate to the main web site page from those tabs by pressing the top logo page, and I would like to invalidate that from x-code without editing the word press template. Basically I would like those tabs to be "static pages". Any one has an idea on how to do that or if it's posible to do it from x-code?

Use UIWebViewDelegate's shouldStartLoadWithRequest method to check the URL your web view is trying to load. If URL is not one of the pages you want to allow access to, return false.

Related

Website wrapped in iOS App - Catching hyperlink click events

I have a iOS app that wraps a website. When the user clicks a link in the wrapped website, I want to trap the event in my app and be able to get information about the link that was clicked. Is this something that can be done in Swift?
I'm relatively new to iOS app development and I'm working on an app that has been around for a while.
The short answer is "Yes". There are a couple of views that you can use in iOS to display web content. One such view is WKWebView.
If you look at the documentation at that link, close to the bottom of the page you will find a header for "Managing Navigation Through your Web Content".
What you do is create a WKNavigationDelegate that you attach to your WKWebView. That delegate is notified when the user wants to navigate through the web content (for example, when they click on a link) and lets your application code participate in the navigation process. It can allow navigation, deny navigation, find out when it starts and stop, things of that nature.

How does iOS 13 Safari link preview work?

In iOS 13 Safari, when you long press on a link, you see a preview of the linked page, along with some menu items. If you tap the preview, you navigate to that page.
Now, I see how to intervene in the long-press-and-preview process. This used to be peek-and-pop, but in iOS 13 that's deprecated and we're supposed to use func webView(_:contextMenuConfigurationForElement:) and so forth. Fine, but how would I imitate what Safari does?
The problem is that as my preview provider I have to supply a view controller. So I'm going to need a different view controller with a web view showing the linked page. Okay, I can do that. But then when the user taps the preview to dismiss it, I want to respond by loading the same linked page into my real web view.
But that's the problem. That loading takes time. In Safari, by contrast, when you tap the preview, boom, there's the same page already loaded. How do they do that? How would I do the same thing? How can I load the page into a different view controller, cache it, and communicate that cached page back to my real web view?

Best way to realize multi page site in Vaadin

I'm working on pretty simple web side that cointains login screen (almost same as in demo presentation, white page with login and password) and main screen with sidebar and navigation bar. How should it be done? My plan is to build main screen using navigation bar, sidebar (just few buttons in layout basicly) and few layouts with content of the webside. On each button click change layout used to create content to another one, for example for Schudele button I'm gonna load layout that contains some tables, for About button plain text. Is it good idea?
So finnaly is should look like this:
init() function decides if user is logged or not and display Login page or Main page, Main Page is builded from modules like navbar, sidebar and content, content depends on sidebar buttons click. I'm right?
Handling it on your own is legit way to start or learn Vaadin. If you have a first grasp of this works out, the most common way to handle such a scenario is the use of the Navigator See the book of Vaadin.
With the Navigator you define Views and give them a name, register them with the Navigator. Then you can navigate your application with the Navigator, it takes care to give you nice ...#!view... URLs so the Users can have bookmarks and navigate your app also e.g. with the back button in the browser.
The Navigator hooks into an event system, where listeners (ViewChangeListener) can react to "before enter" and "leave". The "before enter" can be used to realize auth needs, since they are allowed to object entering a view.

disable external url links in UIWebView

I used some open resource to handle my external links in WebView, so right now every time I click the url a new view would show the page with "Done" "back" "forward" "open link in safari" something like that. But at the same time the earlier webview of my app is still loading and show the url website. How could I stop it? When the user click Done for the new page, definitely they want to go back to the earlier page.
here is the open resource class I used : https://github.com/samvermette/SVWebViewController
Thanks. wish I made myself clear. I'm new here, and also new to ios development.
Not entirely clear what you're asking but every time a link is clicked in a UIWebView, the UIWebView delegate shouldStartLoadWithRequest method gets called.
If you don't want the link to load you simply return NO from this method.
There are also properties in the UIWebView class to enable you to go back or go forward through the page history.
If that doesn't answer your question, can you try and rephrase it.

How to create tabs in a ipad app that is similar a web browser tabs

I have a requirement to create a ipad app that supports tab to view content. I have created a custom splitview controller, whenever user goes to a particular section in the left section, the contents related to that will be displayed in the content view(right view). If a user selects a particular link in that content view it should open a tab and display the contents of that link in that new view. Similar to Web Browser tabs i need to handle tabs in this app. Please suggest any available open source component or any ideas to implement tabbing inside a ipad app.
You can use Three20 for your tab purpose. Also there are many open Source components available. You just need to search in google.

Resources