Taylor Swift Quiz

About the project

I started creating this app as my first iOS development personal project while being a completely beginner - around 10 days into learning Swift and UIKit. Inspired by my love for Taylor Swift's music, it began as a simple quiz app but grew as I was studying and learning. And while I was developing it, I continually added some new features and refactored the code to improve my skills and to adapt with what I had learn.

With that being said, it reflects my journey from a novice to a little bit more experienced developer and combines my passion for music with my growing proficiency in iOS development.

Technologies used

UIKit • Auto Layout • URLSession • CoreData • MongoDB - Realm

Features

  • MVVM Architecture - Adopted for better manageability and separation of responsabilities.
  • API Communication and Service Layer: Implemented URLSession for network requests to interact with a simulated JSON API, to ensure modularity of the code and efficient data retrieval.
  • CoreData Integration: Singleton pattern for centralized user data management, and incorporated a mechanism to reset stored data upon the start of a new game session, handling scenarios where the app is closed prematurely or terminated by the system to prevent unused data to be saved.
  • Database Integration: Integrated MongoDB for storing user details, leveraging CoreData at the final score screen, in order to contribute to robust data management and scalability.
  • Gameplay Customization: Enabled players to personalize their quiz experience by choosing difficulty levels and favorite Taylor Swift eras, which influences both the questions and the UI theme, aiming to improve user engagement.
  • Dynamic Content and Logic: Developed a method to fetch questions based on the user-selected difficulty from the API, ensuring an unique and engaging gameplay experience each time.
  • Leaderboard Implementation: Created a leaderboard using UITableView to display player rankings and details, showcasing efficient data retrieval and presentation.

Move your cursor over each section to display the corresponding screen

As soon as the app launches, users are prompted to enter their name, always respecting the character limits. They have the option to personalize their profile by choosing a photo from their camera roll or taking a new one with the iPhone's camera.

Then, players can select the difficulty level and their favorite Taylor Swift era, for a more personalized game experience. The 'Next' button activates only after these choices are made, guiding users smoothly through the setup process.

When confirming the answers to each question, they change to green or red, providing instant feedback. Also, if a user accidentally hits 'Start New Game', a confirmation alert ensures they don't lose their current progress unintentionally.

After completing the quiz and viewing their total score, users can access the leaderboard. Here, they can navigate through a table view to see the scores of other players, developing a sense of competition and community within the app.

Challenges and Solutions

I would say one of my main challenges was, initially, randomizing the questions after fetching them from the API, which caused them and the answers to mismatch, while I was also getting repeated questions in a single user session. That took me a little bit of time to find out what was going on, but I managed to solve it by modifying the randomization to occur only at the start of each game, ensuring the question-answer integrity and variety (and I must say Xcode's debugging tool saved my life, as usual).

Also, my biggest dilemma was to choose between database-side or local processing for the player rankings. I ended up choosing local processing in order to improve responsiveness and flexibility, favoring the user experience. While making this choice is ideal for smaller data sets, which is my case, is something that needs to be re-evaluated for scalability as the app grows.

What I learned

If I had to highlight the most enriching part of this app development journey, it would without a doubt creating the leaderboard screen, especially the aspect of database interactions. This feature helped me a lot expanding my understanding of databases, an area I hadn't deeply got into before. And I also have to say that my decision to work with both CoreData and MongoDB was deliberate; although managing only one database would have been enough, I wanted the challenge of learning both to enhance my skill set. Looking back, for my first incursion into iOS development, starting with minimal knowledge, I can say that I exceeded my own expectations.