From 81116f82ca5206db805d2337310114ece6a486b9 Mon Sep 17 00:00:00 2001 From: noeyiz Date: Tue, 9 Apr 2024 11:37:34 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=9B=B9=EB=B7=B0=20=EB=82=B4=20?= =?UTF-8?q?=EB=A1=9C=EB=94=A9=20=EC=B6=94=EC=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- iBox/Sources/Web/WebView.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/iBox/Sources/Web/WebView.swift b/iBox/Sources/Web/WebView.swift index 22cbe7b..1305900 100644 --- a/iBox/Sources/Web/WebView.swift +++ b/iBox/Sources/Web/WebView.swift @@ -103,12 +103,18 @@ class WebView: UIView { extension WebView: WKNavigationDelegate { + func webView(_ webView: WKWebView, didStartProvisionalNavigation navigation: WKNavigation!) { + // 로딩 시작 시 프로그레스 바를 보여주고 진행률 초기화 + progressView.isHidden = false + progressView.setProgress(0.0, animated: false) + } + func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { progressView.setProgress(1.0, animated: true) - // 약간의 딜레이를 주어서 프로그레스 바가 완전히 차도록 함 + // 약간의 딜레이 후 프로그레스 바를 숨김 DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { self.progressView.isHidden = true } } - + }