Challenge: Design a quiz in Swift Playgrounds – Discover

Do the people in your life know your favorite animal clothes? What about the book that changed your life? Your least favorite pizza topping? Design a “How well do you know me?” quiz to see who knows the most about your quirks and interests.

Start the challenge

This challenge invites you to create a quiz using the Answers book in Swift Playgrounds. Your “How Do You Know Me” quiz should ask a series of questions and ultimately return a score (and possibly a colorful description!) Based on how many questions were answered correctly.

To get started, download and open Swift Playgrounds on your iPad or Mac, then select View All in the lower right corner to launch the Swift Playgrounds content screen. From here you can find the Answers book under “Starting points” and download a copy to your device.

Use the Swift Playgrounds app to download the Answers book for this challenge.

Use the Swift Playgrounds app to download the Answers book for this challenge.

Answers’ starting point contains a page called “API Overview”, which dives into the API for this playground. You can use show call to view text or images, and use several different ones ask calls to request feedback from the player and save their answers as variables. You can use the combination of these API calls to build your own custom quiz questions and check answers to your own answer key.

You can use Answers to build all sorts of different text-based trees and quizzes, and if you feel strongly about making a different type of quiz, do it! We strongly encourage you to explore different ways to use this starting point to do something you are passionate about. And if you’d like to share what you’ve built with the community, you can post a video of your quiz in action or share a link in developer forums.

Visit the Apple Developer Forums

Resources

Download Swift Playgrounds for macOS

Learn more about Swift Playgrounds

Read the terms and conditions of WWDC21 Challenges

Leave a Comment