Skip to content

Commit

Permalink
Feature/response filtering (#94)
Browse files Browse the repository at this point in the history
Release 1.2.1
  • Loading branch information
dmytrokhl committed Feb 21, 2020
1 parent 77160ac commit 18fd2cd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VGSCollectSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = 'VGSCollectSDK'
spec.version = '1.2.0'
spec.version = '1.2.1'
spec.summary = 'VGS Collect - is a product suite that allows customers to collect information securely without possession of it.'
spec.swift_version = '5.0'
spec.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions demoapp/demoapp/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ extension ViewController {
// send data
vgsForm.submit(path: "post", extraData: extraData, completion: { [weak self] (json, error) in
self?.consoleStatusLabel.text = "RESPONSE"
if error == nil, let json = json {
self?.consoleLabel.text = (String(data: try! JSONSerialization.data(withJSONObject: json, options: .prettyPrinted), encoding: .utf8)!)
if error == nil, let data = json?["json"] {
self?.consoleLabel.text = (String(data: try! JSONSerialization.data(withJSONObject: data, options: .prettyPrinted), encoding: .utf8)!)
} else {
self?.consoleLabel.text = "Something went wrong!"
print("Error: \(String(describing: error?.localizedDescription))")
Expand Down
4 changes: 2 additions & 2 deletions framework/Sources/VGSFramework/Core/APIClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ class APIClient {
switch response.result {
case .success(let data):

guard let dict = data as? JsonData, let json = dict["json"] as? JsonData else {
guard let dict = data as? JsonData else {
block(nil, nil)
return
}
block(json, nil)
block(dict, nil)

case .failure(let error):
block(nil, error)
Expand Down

0 comments on commit 18fd2cd

Please sign in to comment.