Skip to content

Fact Attack! is a simple mobile app that fetches random images and facts about cats, dogs, and ducks using various APIs. Simply tap the button to get a new image and fact.

Notifications You must be signed in to change notification settings

bacf5/fact-attack

Repository files navigation

✨ Fact Attack! 🐾 ✨

image

FactAttack screen

Table of Contents

Description

Fact Attack! is a lightweight app that delivers random images and facts about cats, dogs, and ducks, with the tap of a button. Using multiple APIs, instantly fetches a fresh picture and an interesting "facto" for the selected animal. Navigation is handled through simple TabViews, letting you switch seamlessly between your favorite animal.

Motivation

So i made Fact Attack! because obviusly i love these animals, but also, combine that with my journey in learning SwiftUI development. This project was the opportunity to practice asynchronous API calls, explore the MVVM architecture, work with URLSession for networking, and use JSONDecoder() to handle data parsing to name a few.

Built with

  • SwiftUI
  • Xcode 16.4

Concepts explored

TabView • .sensoryFeedback() • JSONDecoder() • Async API Calls • Async Image Loading • task() • do-catch • Access Control • MVVM • @Observable • @MainActor • Privacy • get/set • Separation of Concern etc

Preview

image

To-do

  • Fix Duck icon 🦆 in TabView (dark mode appears too dark).
  • Replace default ProgressView with a custom loader or something else.
  • Add animation and improved styling to the main button.
  • Add an “Info” viewSheet with Wikipedia Info and links for each animal. Maybe?
  • Create a custom REST API for duck facts (none currently available that i could find). duck API
  • Add images and GIFs to the README to showcase the app
  • Include a disclaimer that facts are not verified lol
  • Add sound feedback when you tap the button
  • Make the img tapable to enlarge - probably.
  • Add a form to POST a new duck fact into my API.
  • GET a new duck fact from my API.
  • ~~Add a custom launch screen. ~~ <- NOPE // tbh i did it but was super ugly.
  • Added sensory feedback when you tap the button
  • Added facts for ducks view
  • iOS 26 liquid glass update

Note

The app icon and the background images are made with Gemini AI.


I was mainly experimenting to become more familiar with SwiftUI and Xcode.

Thanks to the following API that I use in this app:

Ciao.

About

Fact Attack! is a simple mobile app that fetches random images and facts about cats, dogs, and ducks using various APIs. Simply tap the button to get a new image and fact.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages