Skip to content

Commit

Permalink
Merge pull request #183 from guoyingtao/ImproveReadme
Browse files Browse the repository at this point in the history
Improved sample code of storage's async functions in README
  • Loading branch information
vadymmarkov authored May 4, 2018
2 parents b6e7b35 + cbc6e3d commit a5d5af3
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ storage.async.setObject("Oslo", forKey: "my favorite city") { result in
print("saved successfully")
case .error(let error):
print(error)
}
}
}

Expand All @@ -222,7 +221,6 @@ storage.async.object(ofType: String.self, forKey: "my favorite city") { result i
print("my favorite city is \(city)")
case .error(let error):
print(error)
}
}
}

Expand All @@ -233,11 +231,21 @@ storage.async.existsObject(ofType: String.self, forKey: "my favorite city") { re
}

storage.async.removeAll() { result in
print("removal completes")
switch result {
case .value:
print("removal completes")
case .error(let error):
print(error)
}
}

storage.async.removeExpiredObjects() { result in
print("removal completes")
switch result {
case .value:
print("removal completes")
case .error(let error):
print(error)
}
}
```

Expand Down

0 comments on commit a5d5af3

Please sign in to comment.