From 642372439a3f5b29800795b34bd92c1be0e54188 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fl=C3=A1vio=20Caetano?= Date: Tue, 18 Apr 2017 15:35:55 -0300 Subject: [PATCH] Updating README --- README.md | 13 +++++++++---- ReCaptcha.podspec | 17 +++-------------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 6335f67..499b26e 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,6 @@ let recaptcha = try? ReCaptcha() override func viewDidLoad() { super.viewDidLoad() - recaptcha?.presenterView = view recaptcha?.configureWebView { [weak self] webview in webview.frame = self?.view.bounds ?? CGRect.zero } @@ -39,15 +38,21 @@ override func viewDidLoad() { func validate() { - recaptcha?.validate { [weak self] result in + recaptcha?.validate(on: view) { [weak self] result in print(try? result.dematerialize()) } } ``` -## Author +You can also install the reactive subpod and use it with RxSwift: -Flávio Caetano, flavio@vieiracaetano.com +``` swift +recaptcha.rx.validate(on: view) + .map { try $0.dematerialize() } + .subscribe(onNext: { (token: String) in + // Do something + }) +``` ## License diff --git a/ReCaptcha.podspec b/ReCaptcha.podspec index 1feea3d..3fc8660 100644 --- a/ReCaptcha.podspec +++ b/ReCaptcha.podspec @@ -1,24 +1,13 @@ -# -# Be sure to run `pod lib lint ReCaptcha.podspec' to ensure this is a -# valid spec before submitting. -# -# Any lines starting with a # are optional, but their use is encouraged -# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html -# Pod::Spec.new do |s| s.name = 'ReCaptcha' s.version = '0.2.0' s.summary = 'ReCaptcha for iOS' -# This description is used to generate tags and improve search results. -# * Think: What does it do? Why did you write it? What is the focus? -# * Try to keep it short, snappy and to the point. -# * Write the description between the DESC delimiters below. -# * Finally, don't worry about the indent, CocoaPods strips it! - s.description = <<-DESC -Add Google invisible ReCaptcha to your app +Add Google's [Invisible ReCaptcha](https://developers.google.com/recaptcha/docs/invisible) to your project. This library +automatically handles ReCaptcha's events and retrieves the validation token or notifies you to present the challenge if +invisibility is not possible. DESC s.homepage = 'https://github.com/fjcaetano/ReCaptcha'