WKWebView Bridge 연결하기 - 뀔뀔(swieeft)의 개발새발기
https://velog.io/@cskime/iOS-Web과-통신하기a.k.a-JavaScript-Interface https://g-y-e-o-m.tistory.com/13
토큰갱신방법 https://ios-development.tistory.com/730 https://sozohoy.tistory.com/25 https://ios-development.tistory.com/751 https://bugle.tistory.com/53 https://velog.io/@chagmn/Swift-Alamofire-사용해보기2 https://github.com/JK0369/ExAlamofire
Javascript <-> Swift WKWebView 통신
Native와 JavaScript 를 서로 연결할때는 브릿지를 설정해야한다.
@IBOutlet weak var webView: WKWebView!
override func viewDidLoad() {
super.viewDidLoad()
webView.configuration.userContentController.add(self, name: "브릿지 이름")
}
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
let injectMethod = "test()"
webView.evaluateJavaScript(injectMethod) { (result, error) in
if let result = result {
print("1Result: \\(result)")
}
if let error = error {
print("1Error: \\(error.localizedDescription)")
}
}
}
https://zetal.tistory.com/entry/WKUserContentController https://developer.apple.com/documentation/webkit/wkusercontentcontroller https://it-highjune.tistory.com/26 https://sosoingkr.tistory.com/19
https://boidevelop.tistory.com/98?category=839928 https://zeddios.tistory.com/281
https://g-y-e-o-m.tistory.com/13 https://ios-development.tistory.com/401
WKWebView 쿠키관리
https://taesulee.tistory.com/6 https://stackoverflow.com/questions/39772007/wkwebview-persistent-storage-of-cookies