Module Outline

Use the following resources and work with your mentor to master the objectives for this module. Practice by completing the Mini-Project, Project, and Challenges.

Video Challenges

  • Sort the Array

    Using the Playground used in the Group Demo for this objective, sort the array of people by age in ascending order.

    Map an array of ages and sort that array in descending order.

  • App Icon
    • Create an URLSessionDownloadTask to get poster art
    • Display the album art on the View Controller

Stretch Problem

    Closures

    1. Use filter to create an array that contains all the numbers that are multiples of 3 from the array [11,23,43,44,59,43,88,92,58,11,13,14,15]. Print your result
    2. Find the largest number from the previous number array and then print it. Use reduce to solve. Print your result.
    3. Join all the string objects in ["I", "Love", "Dev Mountain"] into one string using reduce. Make sure spaces are in between each string. Print your result.

    ♦ Black Diamond

    In one line convert [["Mama": "too cold", "Papa": "too hot", "Baby": "just right"]] into an array with only one element that contains a string describing Mama, Papa, and Baby bear's porridge temperature. FlatMap, reduce, and anonymous closure arguments will be your friend.

  • Hint
  • Solution

Guided Project

    Deck Of One Card

    DeckOfOneCard lets students practice using closure syntax, network API documentation, and making network calls using URLSession.

Project

  • Representative

    Students will build an app to get the representives (law makers) in a user-requested state to practice asyncronous network requests, working with JSON data, closures, and intermediate table views.

    ReadMe

Mastery Review

Module 18 - Codable (Decoder) - Introduction
  • Expand all
  • Collapse all
  • Closures stretch problem
  • Challenges
    • Sort the Array objective challenge
    • App Icon objective challenge
  • Deck Of One Card guided project