A simple Pokémon application that fetches and displays a list of Pokémon using the PokéAPI. This app utilizes Swift, SwiftUI, UIKit, and Combine, following the MVVM architecture pattern.
DemoPokemon.mov
- Fetches Pokémon data from the PokéAPI.
- Displays Pokémon names, URLs, and images in a table view.
- Navigates to a detail view for more information about the selected
Pokémon.
- Built with programmatic UI and supports unit and UI testing.
- Swift
- SwiftUI + UIKit
- Combine
- MVVM Architecture
- XCTest for Unit and UI Testing
The app fetches data from the PokéAPI. The following endpoint is used to retrieve Pokémon data:
- Endpoint:
https://pokeapi.co/api/v2/pokemon?limit=100
The application follows the MVVM architecture:
- Model: Represents the data structure (e.g.,
Pokemon
). - ViewModel: Fetches data from the API, handles business logic, and provides data to the views.
- View: Displays the data and handles user interactions.
The app uses a custom table view cell to display each Pokémon's name, URL, and image. The cell is designed programmatically for better flexibility and customization.
Users can tap on a Pokémon in the list to navigate to a detail view that provides additional information about the selected Pokémon.
The app includes both unit and UI tests to ensure functionality and performance. You can run the tests using the Xcode testing framework.
- Open the
Test Navigator
in Xcode. - Select the desired tests and click the run button.
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request.