<instance method> webView(_:decidePolicyFor:decisionHandler:)

dlsl7380·2022년 2월 8일
0

Instance method

목록 보기
19/19

webView(_:decidePolicyFor:decisionHandler:)

Asks the delegate for permission to navigate to new content after the response to the navigation request is known.
탐색 요청에 대한 응답이 알려진 후 대리인에게 새 콘텐츠 탐색 권한을 요청합니다.

Declaration

optional func webView(_ webView: WKWebView, 
      decidePolicyFor navigationResponse: WKNavigationResponse, 
      decisionHandler: @escaping (WKNavigationResponsePolicy) -> Void)

Parameters

webView
The web view from which the navigation request began.
탐색 요청이 시작된 웹 보기입니다.
navigationResponse
Descriptive information about the navigation response.
탐색 응답에 대한 설명 정보입니다.
decisionHandler
A completion handler block to call with the results about whether to allow or cancel the navigation. This handler has no return value and takes the following parameter:
탐색을 허용할지 취소할지 여부에 대한 결과와 함께 호출할 완료 처리기 블록입니다. 이 핸들러에는 반환 값이 없으며 다음 매개변수를 사용합니다.
policy
A constant that indicates whether to cancel or allow the navigation. For a list of possible values, see WKNavigationResponsePolicy.
탐색을 취소할지 허용할지 여부를 나타내는 상수입니다. 가능한 값 목록은 WKNavigationResponsePolicy를 참조하세요.

Discussion

Use this method to allow or deny a navigation request after the web view receives the response to its original URL request.
이 방법을 사용하여 웹 보기가 원래 URL 요청에 대한 응답을 받은 후 탐색 요청을 허용하거나 거부합니다.
The navigationResponse parameter contains the details of the response, including the type of data that the response contains.
navigationResponse 매개변수에는 응답에 포함된 데이터 유형을 포함하여 응답에 대한 세부 정보가 포함됩니다.
If you implement this method, always execute the decisionHandler block at some point.
이 메서드를 구현하는 경우 항상 특정 시점에서 decisionHandler 블록을 실행합니다.
You may execute it synchronously from your delegate method’s implementation, or execute it asynchronously after your method returns.
대리자 메서드의 구현에서 동기식으로 실행하거나 메서드가 반환된 후 비동기식으로 실행할 수 있습니다.

0개의 댓글

관련 채용 정보