1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

ServiceNowのServicePortalをiPadのWebViewで表示

Last updated at Posted at 2022-04-30

WKWebViewでServicePortalを表示する

結論

公式ドキュメントに則って、URLにServicePortalのURLを貼り付ければWebViewでServicePortalを表示することが可能。

環境

Xcode : 13.2/iPad Air 5th/iOS : 15.3

実装方法

公式Docs : https://developer.apple.com/documentation/webkit/wkwebview

以下、コード。

import UIKit
import WebKit
class ViewController: UIViewController, WKUIDelegate {
    
    var webView: WKWebView!
    
    override func loadView() {
        let webConfiguration = WKWebViewConfiguration()
        webView = WKWebView(frame: .zero, configuration: webConfiguration)
        webView.uiDelegate = self
        view = webView
    }
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let myURL = URL(string:"<ServicePortalのURL>")
        let myRequest = URLRequest(url: myURL!)
        webView.load(myRequest)
    }}

image.png

まだ、詳細な動きの確認はできてませんが表示させることはできます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?