The Rick and Morty API Swift Client
Swift implementation to the awesome Rick and Morty API
Table of Contents
Installation
For instructions how to add a Swift package to your projects look here:
Apple - Adding package dependencies to your app
Usage
Example to get all characters as an array of character struct:
1. Init client:
let rmClient = RMClient()
2. Call character struct with function
var cancellable: AnyCancellable?
cancellable = rmClient.character().getAllCharacters()
.sink(receiveCompletion: { _ in }, receiveValue: { characters in
characters.forEach() { print ($0.name) }
})
For more examples, please refer to the Documentation or visit Test Section
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the repo and create your branch from master.
- If you’ve added code that should be tested, add tests.
- If you’ve changed APIs, update the documentation.
- Ensure the test suite passes.
- Issue that pull request!
License
Distributed under the MIT License. See LICENSE
for more information.