Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukepistrol committed May 16, 2022
1 parent 8cb6a4c commit c32fcf2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let pexels = PexelsSwift.shared
// set your API key
pexels.setup(apiKey: "YOUR_API_KEY", logLevel: .debug)

// fetch images metadata
// fetch images metadata using async/await
let result = await pexels.getCuratedPhotos()

switch result {
Expand All @@ -36,6 +36,16 @@ case .failure(let error):
case .success(let photos):
// access photos
}

// fetch images metadata using completion handlers
pexels.getCuratedPhotos() { result in
switch result {
case .failure(let error):
print(error.description)
case .success(let photos):
// access photos
}
}
```

## Demo Project
Expand Down
12 changes: 11 additions & 1 deletion Sources/PexelsSwift/Documentation.docc/Documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let pexels = PexelsSwift.shared
// set your API key
pexels.setup(apiKey: "YOUR_API_KEY", logLevel: .debug)

// fetch images metadata
// fetch images metadata using async/await
let result = await pexels.getCuratedPhotos()

switch result {
Expand All @@ -36,6 +36,16 @@ case .failure(let error):
case .success(let photos):
// access photos
}

// fetch images metadata using completion handlers
pexels.getCuratedPhotos() { result in
switch result {
case .failure(let error):
print(error.description)
case .success(let photos):
// access photos
}
}
```

## Demo Project
Expand Down

0 comments on commit c32fcf2

Please sign in to comment.