Skip to content

Instantly share code, notes, and snippets.

@jerrypm
Last active September 13, 2018 09:35
Show Gist options
  • Save jerrypm/530fc1006cf7b08673f0e9143c26b0c7 to your computer and use it in GitHub Desktop.
Save jerrypm/530fc1006cf7b08673f0e9143c26b0c7 to your computer and use it in GitHub Desktop.
//
// PopUpViewController.swift
//
// Created by Jerry on 28/03/18.
// Copyright © 2018 Jerry. All rights reserved.
//
import UIKit
import WebKit
import SVProgressHUD
class PopUpViewController: UIViewController, WKNavigationDelegate {
var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
webViewSy()
SVProgressHUD.show()
webView.navigationDelegate = self
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
print(webView.url!) //Check link
print("loaded")
SVProgressHUD.dismiss()
}
func webViewSy() {
let url = URL(string: "https://gist.github.com/")
let request = URLRequest(url: url!)
webView.load(request)
view.addSubview(webView)
webView.topAnchor.constraint(equalTo: viewV.topAnchor, constant: 16).isActive = true
webView.bottomAnchor.constraint(equalTo: bExit.topAnchor, constant: -8).isActive = true
webView.leadingAnchor.constraint(equalTo: viewV.leadingAnchor, constant: 16).isActive = true
webView.trailingAnchor.constraint(equalTo: viewV.trailingAnchor, constant: -16).isActive = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment