iStarWars
- Overview
- Project Goals
- What’s Inside? (Technologies Used)
- Screenshots
- How to Get Started!
- Setup Prerequisites
- Project Structure
- What’s Next?
- Author
- Contributing
- Code of Conduct
- License
The iStarWars iOS Project is a fun little app that fetches and displays a list of planets from the Star Wars API (SWAPI). It’s built to show off some cool iOS development techniques while keeping things clean and easy to understand.
SWAPI - The Star Wars API https://swapi.dev/
All the Star Wars data you've ever wanted: Planets, Spaceships, Vehicles, People, Films and Species From all SEVEN Star Wars films Now with The Force Awakens data!
This project is designed to demonstrate best practices in iOS development, making it an excellent resource for learning and reference.
- Demonstrate Clean Architecture and MVVM in a real-world iOS app.
- Showcase the use of Combine and Async/Await for modern iOS development.
- Provide a reference for implementing Unit Testing in Swift.
- Highlight the power of SwiftUI for building dynamic and responsive UIs.
- Planet List: Fetches and shows a list of planets from the Star Wars universe.
- Swift: The primary programming language for iOS development.
- SwiftUI: A declarative framework for building dynamic UI, making it dynamic and responsive user interfaces.
- Clean Code: The app is structured using
- Clean Architecture Separates the app into distinct layers (Presentation, Domain, and Data) for better scalability and testability, separates concerns
and - MVVM-C: Model-View-ViewModel architecture with Coordinators for navigation and separation of concerns that ensures a clear separation between the UI, business logic, and data layers.
- Modern Tools:
- Uses Combine: Used for reactive programming and state management, enabling seamless data flow and updates.
- And Async/Await: Modern concurrency techniques for efficient and readable asynchronous code.
- Caching: Implemented with
URLCache
for offline support. - Testing: Comes with Unit Tests to make sure everything works as expected.
- CocoaPods: For dependency management (e.g., SwiftLint).
- Makefile
- Bundler
A picture says a thousand words
- Clone the repo.
- Open it in Xcode check Prerequisites.
- Run the app to see the list of planets.
- Explore the code to see how everything fits together.
- Xcode: 16.2
- Swift: 5
Main Branch
- Dependency Management: Using Swift Package Manager (SPM).
- No CocoaPods or additional scripts required.
Other Branch
- Dependency Management: Using CocoaPods and requires running a setup script.
To set up the project, follow these steps:
- Open Terminal and navigate to the project folder:
cd /path/to/iStarWars
- Run the following command to set up the project:
make start
We use Bundler to manage Ruby gem dependencies.
- Open Terminal and run:
gem install bundler
- For more information about Bundler, visit the official documentation.
Here’s an overview of the folder and file structure for the iStarWars project:
iStarWars/
├── iStarWars.entitlements
├── Readme.md
├── App/
│ ├── iStarWarApp.swift
├── Coordinator/
│ ├── AppCoordinator.swift
│ ├── NavigationPath.swift
│ ├── SceneConfigurator.swift
├── Modules/
│ ├── Planets/
│ │ ├── Configurator/
│ │ │ ├── PlanetsConfigurator.swift
│ │ │ ├── PlanetDetailsConfigurator.swift
│ │ ├── Models/
│ │ │ ├── Planet.swift
│ │ │ ├── PlanetsResponse.swift
│ │ │ ├── Planet+Mock.swift
│ │ ├── Repositories/
│ │ │ ├── PlanetRespository.swift
│ │ │ ├── PlanetRepositoryProtocol.swift
│ │ ├── UseCases/
│ │ │ ├── FetchPlanetsUseCase.swift
│ │ │ ├── FetchPlanetDetailsUseCase.swift
│ │ ├── ViewModels/
│ │ │ ├── PlanetsViewModel.swift
│ │ │ ├── PlanetDetailsViewModel.swift
│ │ ├── Views/
│ │ │ ├── PlanetListView.swift
│ │ │ ├── PlanetRowView.swift
│ │ │ ├── PlanetDetailView.swift
├── Services/
│ ├── Network/
│ │ ├── APIClient.swift
│ │ ├── Endpoints.swift
│ ├── Storage/
│ │ ├── CacheManager.swift
├── Utilities/
│ ├── Constants.swift
│ ├── Environment.swift
│ ├── Errors/
│ │ ├── CustomError.swift
│ │ ├── DataError.swift
│ │ ├── NetworkError.swift
│ ├── Extensions/
│ │ ├── String+Extension.swift
│ ├── UI/
│ │ ├── View+Shimmer.swift
├── Resources/
│ ├── Assets.xcassets
│ ├── Fonts/
│ │ ├── Arabic
│ │ ├── English
│ ├── LaunchScreen.storyboard
Tests/
├── UnitTests/
│ ├── APIClientTests.swift
│ ├── EnvironmentTests.swift
│ ├── CachedManagerTests.swift
│ ├── MockURLProtocol.swift
│ ├── CustomErrorTests.swift
│ ├── NetwrokErrorTests.swift
│ ├── DataErrorTests.swift
│ ├── StringExtensionTests.swift
│ ├── EndpointsTests.swift
│ ├── iStarWarsTests.swift
├── UITests/
│ ├── PlanetListViewUITests.swift
Here are some ideas for future improvements:
- Pagination: Load more planets as the user scrolls to the bottom of the list.
- Search and Filtering: Allows users to search and filter planets by name.
- localize Error Messages: User-friendly messages based on error type (e.g., network error, invalid URL).
- Font manager: Use font , color design.
- CI/CD Pipeline: Set up using GitHub Actions or Bitrise.
- Retry Mechanism: Add a retry button for failed requests.
- Logging: Log errors for debugging purposes.
- Docs: use jazz.
All your feedback and help to improve this project is very welcome. Please create issues for your bugs, ideas and enhancement requests, or better yet, contribute directly by creating a PR. 😎
When reporting an issue, please add a detailed instruction, and if possible a code snippet or test that can be used as a reproducer of your problem. 💥
When creating a pull request, please adhere to the current coding style where possible, and create tests with your code so it keeps providing an awesome test coverage level 💪
I’m here to share my knowledge and findings as I work every day to improve our apps/demos for the community.
This is a space where we work together, openly and safely, as kind and considerate human beings.
We grow by giving and receiving positive, constructive feedback.
Let’s keep learning and building, one step at a time.
MIT License
iStarWars is distributed under the MIT License. For more information, see the LICENSE file.
© 2025 Amr Elghadban
All rights reserved.