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.
Required Preclass Resources
- A Short Practical Guide to Closures
- Gosh Darn Block Syntax
- Higher Order Functions - Map, Filter, Reduce
-
A Beginner's Guide to HTTP and REST
Understand HTTP requests, URLs, and the HTTP Verbs (GET, PUT, DELETE, POST). Do not build the Example Application.
-
What's New in Foundation Networking
WWDC 2014 Video
- Ray Wenderlich URLSession Tutorial
-
About the URL Loading System
Apple's documentation about the URL Loading System. Read as much as you can.
Lesson Video
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
- Hint
- Solution
Making Change
Make a function that takes in a given amount of money i.e. 2.15 and returns a string of the amount of dollars, quarters, dimes, nickels, and pennies needed to make that amount of money. Return something like : Your change is 1 quarter, 2 dimes, 0 nickels, and 1 penny
♦ Black Diamond
Make a function that takes in the cost of an item, and the amount of money paid (i.e. the cost is $2.15 and the amount of money paid is $5.00) and then returns a string detailing the amount of change in dollars, quarters, dimes, nickels, and pennies.
When this works, try to recreate Swift's built-in filter function. Just like the Swift function, it should be generic and it should take a closure that returns a Bool, from which it determines how to filter your sequence type.
Guided Project
Pokedex
Pokedex lets students further practice using closure syntax, read API documentation, and make network calls using URLSession.
Project
-
SubredditCodable
Students will build an app to get the posts in a user-requested subreddit to practice asyncronous network requests, working with JSON data, Codable, closures, and intermediate table views.
ReadMe
Mastery Review
- Making Change stretch problem
- Challenges
- Sort the Array objective challenge
- App Icon objective challenge
- Pokedex guided project