Browse Source

wkwebview opened

pull/1/head
ccr 6 years ago
parent
commit
2c218aaf9a
  1. 19
      GMERemittance/Library/WebLinks/WkWebView/WkWebViewController.swift
  2. 15
      GMERemittance/Module/AutoDebit/User Interface/View/AutoDebitViewController.swift

19
GMERemittance/Library/WebLinks/WkWebView/WkWebViewController.swift

@ -17,7 +17,7 @@ class WkWebViewController: UIViewController, WKUIDelegate {
override func loadView() {
let webConfiguration = WKWebViewConfiguration()
webView = WKWebView(frame: .zero, configuration: webConfiguration)
webView = WKWebView()
webView.uiDelegate = self
view = webView
}
@ -28,13 +28,14 @@ class WkWebViewController: UIViewController, WKUIDelegate {
if let myURL = URL(string: self.url ?? "") {
var myRequest = URLRequest(url: myURL)
headers.forEach({
myRequest.setValue($0.key ?? "", forHTTPHeaderField: $0.value ?? "")
})
// if let myURL = URL(string: self.url ?? "") {
// var myRequest = URLRequest(url: myURL)
//
// headers.forEach({
// myRequest.setValue($0.key ?? "", forHTTPHeaderField: $0.value ?? "")
// })
let url = URL.init(string: "https://www.apple.com")
let myRequest = URLRequest.init(url: url!)
webView.load(myRequest)
}
}}
}

15
GMERemittance/Module/AutoDebit/User Interface/View/AutoDebitViewController.swift

@ -41,8 +41,14 @@ class AutoDebitViewController: UIViewController {
var url: String?
var selectedLanguage: KftcLanguage? {
didSet {
print(selectedLanguage)
let url = URL.init(string: "")
self.url = "oauth/2.0/authorize2?response_type=code&client_id=&redirect_uri=http://localhost:4948/Dashboard/AutoDebit&scope=login+inquiry+transfer&client_info=GME+CLIENT+INFORMATION&auth_type=1&bg_color=%23F4F8FB&txt_color=%23000000&btn1_color=%23EF343B&btn2_color=%2322246B&lang=&edit_option=off&invoke_type=ajax"
if var url = self.url {
let string = "&lang=\(selectedLanguage?.key ?? "")"
url.append(string)
openWkWebViewWith(url: url)
}
}
}
@ -68,6 +74,11 @@ class AutoDebitViewController: UIViewController {
self.navigationItem.title = ""
}
private func openWkWebViewWith(url: String) {
let viewcontroller = UIStoryboard.init(name: "WKWebView", bundle: nil).instantiateViewController(withIdentifier: "WkWebViewController") as! WkWebViewController
self.present(viewcontroller, animated: true, completion: nil)
}
// MARK:- IBAction
@IBAction func loadMoreAction(_ sender: Any) {

Loading…
Cancel
Save