ReCaptcha/Classes/ReCaptchaWebViewManager.html

269 lines
12 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<title>ReCaptchaWebViewManager Class Reference</title>
<link rel="stylesheet" type="text/css" href="../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../css/highlight.css" />
<meta charset='utf-8'>
<script src="../js/jquery.min.js" defer></script>
<script src="../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Class/ReCaptchaWebViewManager" class="dashAnchor"></a>
<a title="ReCaptchaWebViewManager Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">ReCaptcha Docs</a> (100% documented)</p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../index.html">ReCaptcha Reference</a>
<img id="carat" src="../img/carat.png" />
ReCaptchaWebViewManager Class Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Classes/ReCaptcha.html">ReCaptcha</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ReCaptcha/Endpoint.html"> Endpoint</a>
</li>
<li class="nav-group-task">
<a href="../Classes/ReCaptchaWebViewManager.html">ReCaptchaWebViewManager</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Enums.html">Enumerations</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Enums/ReCaptchaError.html">ReCaptchaError</a>
</li>
<li class="nav-group-task">
<a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../Extensions/Reactive.html">Reactive</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>ReCaptchaWebViewManager</h1>
<div class="declaration">
<div class="language">
<pre class="highlight"><code><span class="n">open</span> <span class="kd">class</span> <span class="kt">ReCaptchaWebViewManager</span></code></pre>
</div>
</div>
<p>Handles comunications with the webview containing the ReCaptcha challenge.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:9ReCaptcha0aB14WebViewManagerC8validateySo6UIViewC2on_Sb12resetOnErroryAA0aB6ResultOc10completiontF"></a>
<a name="//apple_ref/swift/Method/validate(on:resetOnError:completion:)" class="dashAnchor"></a>
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC8validateySo6UIViewC2on_Sb12resetOnErroryAA0aB6ResultOc10completiontF">validate(on:resetOnError:completion:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Starts the challenge validation</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">validate</span><span class="p">(</span><span class="n">on</span> <span class="nv">view</span><span class="p">:</span> <span class="kt">UIView</span><span class="p">,</span> <span class="nv">resetOnError</span><span class="p">:</span> <span class="kt">Bool</span> <span class="o">=</span> <span class="kc">true</span><span class="p">,</span> <span class="nv">completion</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt"><a href="../Enums/ReCaptchaResult.html">ReCaptchaResult</a></span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>view</em>
</code>
</td>
<td>
<div>
<p>The view that should present the webview.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>resetOnError</em>
</code>
</td>
<td>
<div>
<p>If ReCaptcha should be reset if it errors. Defaults to <code>true</code>.</p>
</div>
</td>
</tr>
<tr>
<td>
<code>
<em>completion</em>
</code>
</td>
<td>
<div>
<p>A closure that receives a ReCaptchaResult which may contain a valid result token.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9ReCaptcha0aB14WebViewManagerC4stopyyF"></a>
<a name="//apple_ref/swift/Method/stop()" class="dashAnchor"></a>
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC4stopyyF">stop()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Stops the execution of the webview</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">stop</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9ReCaptcha0aB14WebViewManagerC09configurecD0yySo05WKWebD0CcF"></a>
<a name="//apple_ref/swift/Method/configureWebView(_:)" class="dashAnchor"></a>
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC09configurecD0yySo05WKWebD0CcF">configureWebView(_:)</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Provides a closure to configure the webview for presentation if necessary.</p>
<p>If presentation is required, the webview will already be a subview of <code>presenterView</code> if one is provided. Otherwise
it might need to be added in a view currently visible.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">configureWebView</span><span class="p">(</span><span class="n">_</span> <span class="nv">configure</span><span class="p">:</span> <span class="kd">@escaping</span> <span class="p">(</span><span class="kt">WKWebView</span><span class="p">)</span> <span class="o">-&gt;</span> <span class="kt">Void</span><span class="p">)</span></code></pre>
</div>
</div>
<div>
<h4>Parameters</h4>
<table class="graybox">
<tbody>
<tr>
<td>
<code>
<em>configure</em>
</code>
</td>
<td>
<div>
<p>A closure that receives an instance of <code>WKWebView</code> for configuration.</p>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:9ReCaptcha0aB14WebViewManagerC5resetyyF"></a>
<a name="//apple_ref/swift/Method/reset()" class="dashAnchor"></a>
<a class="token" href="#/s:9ReCaptcha0aB14WebViewManagerC5resetyyF">reset()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Resets the ReCaptcha.</p>
<p>The reset is achieved by calling <code>grecaptcha.reset()</code> on the JS API.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight"><code><span class="n">open</span> <span class="kd">func</span> <span class="nf">reset</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>&copy; 2018 <a class="link" href="https://github.com/fjcaetano/ReCaptcha" target="_blank" rel="external">Flávio Caetano</a>. All rights reserved. (Last updated: 2018-03-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.8.4</a>, a <a class="link" href="http://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>