Provide IOS code for webview. the webview should allow pop-ups and also links to another apps to be opened.
I have a page that has a link which redirects the user to another app. I need the webview to allow that.
Also, the webview should have an (X) button at the top so that the user can close it at any time.
I have the below code which is opening webview, but I need you to adjust it so that it will allow links to other apps to work and the app should stay inside the webview
//
// [login to view URL]
// iosqpay
//
// Created by Laith Ali on 12/10/2021.
//
import UIKit
import WebKit
class ViewController: UIViewController, WKNavigationDelegate, WKUIDelegate {
var webView: WKWebView!
override func viewDidLoad() {
[login to view URL]()
// Do any additional setup after loading the view.
// 1
setupWebView()
let url = URL(string: "[login to view URL]")!
[login to view URL](URLRequest(url: url))
// 2
let refresh = UIBarButtonItem(barButtonSystemItem: .refresh, target: webView, action: #selector([login to view URL]))
toolbarItems = [refresh]
navigationController?.isToolbarHidden = false
}
func setupWebView() {
let preferences = WKPreferences()
[login to view URL] = true
[login to view URL] = true
let configuration = WKWebViewConfiguration()
[login to view URL] = preferences
webView = WKWebView(frame: [login to view URL], configuration: configuration)
[login to view URL] = [.flexibleWidth, .flexibleHeight]
[login to view URL] = self
[login to view URL] = self
[login to view URL](webView)
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
title = [login to view URL]
}
override func loadView() {
webView = WKWebView()
[login to view URL] = self
view = webView
}
}
I will start your work immediately right away. Am having 6+ years experience in iOS app development.
Having much knowledge in WKWebView I can easily move to the another app from your webview. Will complete this work with in 2 hours.
Please ping me to start now.