Updating README

This commit is contained in:
Flávio Caetano 2017-04-18 15:35:55 -03:00
parent a58df63058
commit 642372439a
2 changed files with 12 additions and 18 deletions

View File

@ -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

View File

@ -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'