Quiz for:
CS50 iOS Track 3: Dynamic Data in the Pokedex App

Question 1

Which Swift class is used to create a web request for fetching data?

Question 2

What is the primary purpose of an API in the context of fetching Pokémon data?

Question 3

What does the Base URL 'https://pokeapi.co/api/v2/' represent?

Question 4

What is a closure in Swift?

Question 5

Which Swift keyword is used to decode JSON data into Swift model structs?

Question 6

What is the primary role of the `dataTask(with:)` method in the URLSession class?

Question 7

Why is it necessary to work on the main thread when updating the UI in an iOS app?

Question 8

When fetching detailed Pokémon data, what should be done before updating the UI labels?

Question 9

Which protocol must model structs conform to for JSON decoding in Swift?

Question 10

What key-value pair type is demonstrated in the JSON example from the notes?

Question 11

In what data format is the Pokémon data retrieved from the API?

Question 12

Why is it important to create structs representing nested API responses?

Question 13

How can you sort an array of names in reverse order using closures?

Question 14

Which Swift construct allows for handling potential exceptions during code execution?

Question 15

What does the URL `https://pokeapi.co/api/v2/pokemon?limit=151` represent in the context of the app?