In this article, we will show you How to create WebView App in iOS. This article will give you simple example of How to create WebView App in iOS. you will learn How to create WebView App in iOS. you will come across multiple scenarios where you have to display something in web, for that we use WebView.
we will be seeing how to create WebView and load the data in it. So follow my step and create webview app in ios.
Step 1 :−
Open Xcode and create a single view application.
Step 2 :−
Open ViewController.swift file and copy code and past
Complete code
import UIKit import WebKit class ViewController: UIViewController, WKUIDelegate { var webView: WKWebView! override func viewDidLoad() { super.viewDidLoad() let myURL = URL(string:"https:codeplaners.com") let myRequest = URLRequest(url: myURL!) webView.load(myRequest) } override func loadView() { let webConfiguration = WKWebViewConfiguration() webView = WKWebView(frame: .zero, configuration: webConfiguration) webView.uiDelegate = self view = webView } }