Skip to content

xsu0131/PokemonAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Pokémon App Development Guide

Welcome to the Pokémon App Development Guide! This project is designed to help you understand how to interact with the Pokémon API using SwiftUI and REST API techniques. Below, you'll find detailed instructions on how the app is structured and suggestions for further development.

Project Overview

This iOS app fetches and displays a list of Pokémon using the Pokémon API. It's built using SwiftUI and demonstrates how to perform network requests, handle JSON data, and update the UI dynamically with fetched data.

Features

  • Fetch Data: The app retrieves a list of Pokémon from the Pokémon API.
  • Display Data: Displays the names of Pokémon in a simple, scrollable list.
  • Expandable: The basic setup allows for easy expansion and inclusion of additional API endpoints.

How It Works

APIManager

The APIManager class is central to handling API requests. It uses URLSession to make network calls and parses JSON responses to extract Pokémon data. This class can be extended to include more complex API interactions, such as fetching detailed Pokémon data or pagination handling.

Models

  • PokemonListResponse: A model to decode the list of Pokémon from the API.
  • PokemonEntry: Represents a single Pokémon entry, including its name and URL.

ContentView

The ContentView displays the list of Pokémon. It observes changes in the APIManager to update the UI when new data is fetched.

Expanding Your App

Here are a few ideas on how you can expand the app:

  1. Detailed Pokémon View: Create a new view that shows detailed information about each Pokémon when tapped.
  2. Search Functionality: Add a search bar to allow users to search for Pokémon by name.
  3. Pagination: Implement pagination to load more Pokémon as the user scrolls.

Resources

Conclusion

This project provides a basic framework for building an iOS app with SwiftUI that interacts with a REST API. It's designed to be a starting point for students to learn and create more complex applications using similar techniques. The pokeAPI has numerous endpoints you could integrate into your app so be creative it make it your own.

About

First SwiftUI Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages