Challenge: Design a quiz in Swift Playgrounds – Discover
Do the people in your life know your favorite animal noise? How about the book that changed your life? Your least favorite pizza topping? Design a “What Do You Know About Me?” try to see who knows more about your quirks and interests.
The challenge begins
This challenge invites you to create a quiz with the book Answers to Swift Playgrounds. Your “How do you know me” quiz should ask a series of questions and finally return a score (and possibly a colorful description!) Based on how many questions have been answered correctly.
To get started, download and open Swift Playgrounds on your iPad or Mac, then select View all at the bottom right to start the Swift Playgrounds content screen. From here, you can find the answer book in “Starting Points” and download a copy to your device.
The Answers starting point contains a page called “API Overview”, which goes into the API of this yard. You can use the
show call to display text or images and use several
ask call to ask the player for feedback and store their response as variables. You can use the combination of these API calls to create your own custom quiz questions and check the answers with your own answer key.
You can use Answers to create all kinds of text-based trees and quizzes, and if you feel like doing a different kind of quiz, do it! We encourage you to explore different ways to use this starting point to do something that excites you. And if you want to share what you’ve created with the community, post a video of your quiz in action, or share a link to the developer forums.
Visit the Apple Developer Forums
Download Swift Playgrounds for macOS
Learn more about Swift Playgrounds
Read the WWDC21 Challenge Terms and Conditions