DAY 100

WRAP UP
FINAL EXAM

Today you have one last test: the final exam for the 100 Days of Swift. This one is different from the others in four important ways:

  1. You’ll be tested across all parts of the curriculum: SpriteKit, UIKit, Core Graphics, and more.

  2. The questions are all ones you’ve seen before, although perhaps not for a few months in some cases.

  3. You get a certificate when you pass the test.

Now, I said there were four differences and only listed three above. That’s because the fourth difference might scare you a little, so here goes: there are 100 questions.

DAY 98

The Final Countdown
PROJECT 30 - PART TWO / WRAP UP
Instruments:

Learning About:

  • LocalAuthentication Framework

  • iOS Keychain

  • Keychain Wrapper

  • Practice UITextView

Topics:

  • Setting Up

  • The Basic Text Editor

  • Writing somewhere safe: the iOS Keychain

  • Touch to Activate: Touch ID, Face ID and LocalAuthentication

DAY 97

The Final Countdown
PROJECT 30 - PART ONE
Instruments:

Learning About:

  • Time Profiler

  • Allocations Instruments

  • Draw shadows in Core Graphics and CALayer

  • Re-Using table view cells in code

Topics:

  • Setting Up

  • What are we working with?

  • What can Instruments tell us?

  • Fixing the Bugs: Slow Shadows

  • Fixing the Bugs: Wasted Allocations

DAY 96

The Final Countdown
PROJECT 28 - PART THREE / WRAP UP
Exploding Monkeys:

Learning About:

  • LocalAuthentication Framework

  • iOS Keychain

  • Keychain Wrapper

  • Practice UITextView

Topics:

  • Setting Up

  • The Basic Text Editor

  • Writing somewhere safe: the iOS Keychain

  • Touch to Activate: Touch ID, Face ID and LocalAuthentication

DAY 95

The Final Countdown
PROJECT 29 - PART TWO
Exploding Monkeys:

Learning About:

  • How to make Texture Atlases

  • How to simplify Collision Detection

  • How to transition between scenes

Topics:

  • Unleash the Bananas: SpriteKit texture atlases

  • Destructible Terrain: presentScene

DAY 94

The Final Countdown
PROJECT 29 - PART ONE
Exploding Monkeys:

Learning About:

  • Generate a scene dynamically

  • How to connect SpriteKit and UIKit

Topics:

  • Setting Up

  • Building the Environment: SKTexture and filling a path

  • Mixing UIKit and SpriteKit: UISlider and SKView

DAY 93

The Final Countdown
PROJECT 28 - PART TWO / WRAP UP
Secret Swift:

Challenges:

  • Add a Done button as a navigation bar item that causes the app to re-lock immediately rather than waiting for the user to quit. This should only be shown when the app is unlocked.

  • Create a password system for your app so that the Touch ID/Face ID fallback is more useful. You'll need to use an alert controller with a text field like we did in project 5, and I suggest you save the password in the keychain!

DAY 92

The Final Countdown
PROJECT 28 - PART ONE
Secret Swift:

Learning About:

  • LocalAuthentication Framework

  • iOS Keychain

  • Keychain Wrapper

  • Practice UITextView

Topics:

  • Setting Up

  • The Basic Text Editor

  • Writing somewhere safe: the iOS Keychain

  • Touch to Activate: Touch ID, Face ID and LocalAuthentication

DAY 91

Consolidation X
CORE GRAPHICS REDUX

Topics:

Today you should work through my Learn Core Graphics playground, either in Swift Playgrounds (preferred) or Xcode.

DAY 90

Consolidation X
MILESTONE: PROJECTS 25 - 27

Topics:

  • What you learned

  • Key Points

  • Challenge

Challenges:

Challenge for this milestone is to create a meme generation app using UIImagePickerControllerUIAlertController, and Core Graphics. If you aren’t familiar with them, memes are a simple format that shows a picture with one line of text overlaid at the top and another overlaid at the bottom.

Your app should:

  • Prompt the user to import a photo from their photo library.

  • Show an alert with a text field asking them to insert a line of text for the top of the meme.

  • Show a second alert for the bottom of the meme.

  • Render their image plus both pieces of text into one finished UIImage using Core Graphics.

  • Let them share that result using UIActivityViewController.

DAY 89

Multipeer and Motion
PROJECT 27 - PART TWO / WRAP UP
Core Graphics:

Challenges:

  • Pick any emoji and try creating it using Core Graphics. You should find some easy enough, but for a harder challenge you could also try something like the star emoji.

  • Use a combination of move(to:) and addLine(to:) to create and stroke a path that spells “TWIN” on the canvas.

DAY 88

Multipeer and Motion
PROJECT 27 - PART ONE
Core Graphics:

Learning About:

  • UIGraphicsImageRenderer

  • Drawing Fills

  • Drawing Strokes

  • Insetting a CGRect

  • Practicing NSAttributedString

Topics:

  • Setting Up

  • Creating the Sandbox

  • Drawing into a Core Graphics context with UIGraphicsImageRenderer

  • Ellipses and Checkerboards

  • Transforms and Lines

  • Images and Text

DAY 87

Multipeer and Motion
PROJECT 26 - PART THREE / WRAP UP
Marble Maze:

Challenges:

  • Rewrite the loadLevel() method so that it's made up of multiple smaller methods. This will make your code easier to read and easier to maintain, or at least it should do if you do a good job!

  • When the player finally makes it to the finish marker, nothing happens. What should happen? Well, that's down to you now. You could easily design several new levels and have them progress through.

  • Add a new block type, such as a teleport that moves the player from one teleport point to the other. Add a new letter type in loadLevel(), add another collision type to our enum, then see what you can do.

DAY 86

Multipeer and Motion
PROJECT 26 - PART TWO
Marble Maze:

Learning About:

  • How to load a game level from a file

  • How to create custom physics bit masks

  • Practice fatalError()

  • Practice SKAction

Topics:

  • Setting Up

  • Loading a level: categoryBitMask, collisionBitMask, contactTestBitMask

DAY 85

Multipeer and Motion
PROJECT 26 - PART ONE
Marble Maze:

Learning About:

  • How to load a game level from a file

  • How to create custom physics bit masks

  • Practice fatalError()

  • Practice SKAction

Topics:

  • Setting Up

  • Loading a level: categoryBitMask, collisionBitMask, contactTestBitMask

DAY 84

Undoable due to Network & Connection Issues that are not covered in the course

DAY 83

Multipeer and Motion
PROJECT 25 - PART ONE
Selfie Share:

  • NETWORK & CONNECTION ISSUE

Learning About:

  • Peer to Peer Networking

  • Practice Collection Views

  • Practice GCD

Topics:

  • Setting Up

  • Importing Photos Again

  • Going Peer to Peer: McSession, McBrowserViewController

  • Invitation Only: MCPeerID

DAY 82

Consolidation IX
MILESTONE: PROJECTS 22 - 24

Challenges:

Your challenge this time is not to build a project from scratch. Instead, I want you to implement three Swift language extensions using what you learned in project 24. I’ve ordered them easy to hard, so you should work your way from first to last if you want to make your life easy!

Here are the extensions I’d like you to implement:

  1. Extend UIView so that it has a bounceOut(duration:) method that uses animation to scale its size down to 0.0001 over a specified number of seconds.

  2. Extend Int with a times() method that runs a closure as many times as the number is high. For example, 5.times { print("Hello!") } will print “Hello” five times.

  3. Extend Array so that it has a mutating remove(item:) method. If the item exists more than once, it should remove only the first instance it finds. Tip: you will need to add the Comparable constraint to make this work!

DAY 81

Beacons and Bombs
PROJECT 24 - PART TWO / WRAP UP
Swifty Strings:

Challenges:

  • Create a String extension that adds a withPrefix() method. If the string already contains the prefix it should return itself; if it doesn’t contain the prefix, it should return itself with the prefix added. For example: "pet".withPrefix("car") should return “carpet”.

  • Create a String extension that adds an isNumeric property that returns true if the string holds any sort of number. Tip: creating a Double from a String is a failable initializer.

  • Create a String extension that adds a lines property that returns an array of all the lines in a string. So, “this\nis\na\ntest” should return an array with four elements.

DAY 80

Beacons and Bombs
PROJECT 24 - PART ONE
Swifty Strings:

Learning About:

  • String Subscripts

  • contains(where:)

  • NSAttributedString

Topics:

  • Setting Up

  • Strings are not Arrays

  • Working with Strings in Swift

  • Formatting Strings with NSAttributedString

DAY 79

Beacons and Bombs
PROJECT 23 - PART THREE / WRAP UP
Swifty Ninja:

Challenges:

  • Try removing the magic numbers in the createEnemy() method. Instead, define them as constant properties of your class, giving them useful names.

  • Create a new, fast-moving type of enemy that awards the player bonus points if they hit it.

  • Add a “Game over” sprite node to the game scene when the player loses all their lives.

DAY 78

Beacons and Bombs
PROJECT 23 - PART TWO
Swifty Ninja:

Learning About:

  • SKShapeNode

  • touchesEnded()

  • AVAudioPlayer

Topics:

  • Setting Up

  • Basics quick start: SKShapeNode

  • Shaping up for action: CGPath and UIBezierPath

  • Enemy or Bomb: AVAudioPlayer

DAY 77

Beacons and Bombs
PROJECT 23 - PART ONE
Swifty Ninja:

Learning About:

  • SKShapeNode

  • touchesEnded()

  • AVAudioPlayer

Topics:

  • Setting Up

  • Basics quick start: SKShapeNode

  • Shaping up for action: CGPath and UIBezierPath

  • Enemy or Bomb: AVAudioPlayer

DAY 76

Beacons and Bombs
PROJECT 22 - PART TWO / WRAP UP
Detect-a-Beacon:

Challenges:

  • Write code that shows a UIAlertController when your beacon is first detected. Make sure you set a Boolean to say the alert has been shown, so it doesn’t keep appearing.

  • Go through two or three other iBeacons in the Detect Beacon app and add their UUIDs to your app, then register all of them with iOS. Now add a second label to the app that shows new text depending on which beacon was located.

  • Add a circle to your view, then use animation to scale it up and down depending on the distance from the beacon – try 0.001 for unknown, 0.25 for far, 0.5 for near, and 1.0 for immediate. You can make the circle by adding an image, or by creating a view that’s 256 wide by 256 high then setting its layer.cornerRadius to 128 so that it’s round.

DAY 75

Beacons and Bombs
PROJECT 22 - PART ONE
Detect-a-Beacon:

Learning About:

  • Core Location

  • CLBeaconRegion

Topics:

  • Setting Up

  • Requesting Location: Core Location

  • Hunting the Beacon: CLBeaconRegion

DAY 74

CONSOLIDATION VIII
MILESTONE: PROJECTS 19 - 21
Leveling Up:

Topics:

  • What you learned

  • Key Points

  • Challenge

Topics:

  • Your challenge for this milestone is to use those API to imitate Apple as closely as you can: I’d like you to recreate the iOS Notes app. I suggest you follow the iPhone version, because it’s fairly simple: a navigation controller, a table view controller, and a detail view controller with a full-screen text view.

    How much of the app you imitate is down to you, but I suggest you work through this list:

    • Create a table view controller that lists notes. Place it inside a navigation controller. (Project 1)

    • Tapping on a note should slide in a detail view controller that contains a full-screen text view. (Project 19)

    • Notes should be loaded and saved using Codable. You can use UserDefaults if you want, or write to a file. (Project 12)

    • Add some toolbar items to the detail view controller – “delete” and “compose” seem like good choices. (Project 4)

    • Add an action button to the navigation bar in the detail view controller that shares the text using UIActivityViewController. (Project 3)

DAY 73

Leveling Up
PROJECT 21 - PART TWO / WRAP UP
Local Notification:

Challenges:

  • Update the code in didReceive so that it shows different instances of UIAlertController depending on which action identifier was passed in.

  • For a harder challenge, add a second UNNotificationAction to the alarm category of project 21. Give it the title “Remind me later”, and make it call scheduleLocal() so that the same alert is shown in 24 hours. (For the purpose of these challenges, a time interval notification with 86400 seconds is good enough – that’s roughly how many seconds there are in a day, excluding summer time changes and leap seconds.)

  • And for an even harder challenge, update project 2 so that it reminds players to come back and play every day. This means scheduling a week of notifications ahead of time, each of which launch the app. When the app is finally launched, make sure you call removeAllPendingNotificationRequests() to clear any un-shown alerts, then make new alerts for future days.

DAY 72

Leveling Up
PROJECT 21- PART ONE
Local Notification:

Learning About:

  • UNUserNotificationCenter

  • Requesting Permission for Notification:

  • Different Kinds of Notification Trigger

Topics:

  • Setting Up

  • Scheduling notifications: UNUserNotificationCenter and UNNotificationRequest

  • Acting on responses

DAY 71

Leveling Up
PROJECT 20 - PART TWO / WRAP UP
Fireworks Night:

Learning About:

  • Making things go bang: SKEmitterNode

  • Wrap Up

  • Review for Project 20

Challenges:

  • For an easy challenge try adding a score label that updates as the player’s score changes.

  • Make the game end after a certain number of launches. You will need to use the invalidate() method of Timer to stop it from repeating.

  • Use the waitForDuration and removeFromParent actions in a sequence to make sure explosion particle emitters are removed from the game scene when they are finished.

DAY 70

Leveling Up
PROJECT 20 - PART ONE
Fireworks Night:

Learning About:

  • UIBezierPath

  • SKAction.follow()

  • For case let

Topics:

  • Setting Up

  • Ready… aim… fire: Timer and follow()

  • Swipe to select

DAY 69

Leveling Up
PROJECT 19 - PART THREE / WRAP UP
JavaScript Injection:

Challenges:

  • Add a bar button item that lets users select from a handful of prewritten example scripts, shown using a UIAlertController – at the very least your list should include the example we used in this project.

  • You're already receiving the URL of the site the user is on, so use UserDefaults to save the user's JavaScript for each site. You should convert the URL to a URL object in order to use its host property.

DAY 68

Leveling Up
PROJECT 19 - PART TWO
JavaScript Injection:

Learning About:

  • UITextView

  • NotificationCenter

Topics:

  • Establishing communication

  • Editing multiline text with UITextView

  • Fixing the keyboard: NotificationCenter

DAY 67

Leveling Up
PROJECT 19 - PART ONE
JavaScript Injection:

Learning About:

  • Extensions

  • NSExtensionItem

  • Introduction to JavaScript

Topics:

  • Setting Up

  • Making a shell app

  • Adding an extension: NSExtensionItem

  • What do you want to get?

DAY 66

CONSOLIDATION VII
MILESTONE: PROJECTS 16 - 18

Challenge:

  • Make a shooting gallery game using SpriteKit: create three rows on the screen, then have targets slide across from one side to the other. If the user taps a target, make it fade out and award them points.

  • This project takes time to design the visual assets to make it look like what I want. I will comeback to this

DAY 65

Maps and Bugs:
PROJECT 18 - PART TWO / WRAP UP
Debugging

Challenges:

  • Temporarily try adding an exception breakpoint to project 1, then changing the call to instantiateViewController() so that it uses the storyboard identifier “Bad” – this will fail, but your exception breakpoint should catch it.

  • In project 1, add a call to assert() in the viewDidLoad() method of DetailViewController.swift, checking that selectedImage always has a value.

  • Go back to project 5, and try adding a conditional breakpoint to the start of the submit() method that pauses only if the user submits a word with six or more letters.

DAY 64

Maps and Bugs:
PROJECT 18 - PART ONE
Debugging

Learning About:

  • assert()

  • Breakpoints

  • View Debugging

Topics:

  • Setting Up

  • Basic Swift Debugging using print()

  • Debugging with assert()

  • Debugging with breakpoints

  • View Debugging

DAY 63

Maps and Bugs:
PROJECT 17 - PART TWO / WRAP UP
Space Race

Challenges:

  • Stop the player from cheating by lifting their finger and tapping elsewhere – try implementing touchesEnded() to make it work.

  • Make the timer start at one second, but then after 20 enemies have been made subtract 0.1 seconds from it so it’s triggered every 0.9 seconds. After making 20 more, subtract another 0.1, and so on. Note: you should call invalidate() on gameTimer before giving it a new value, otherwise you end up with multiple timers.

  • Stop creating space debris after the player has died.

DAY 62

Maps and Bugs:
PROJECT 17 - PART ONE
Space Race

Learning About:

  • Pixel - Perfect Collision Detection

  • Timer

  • LinearDamping

Topics:

  • Setting Up

  • Space: The Final Frontier

  • Bring on the Enemies: linearDamping, angularDamping

  • Making Contact: didBegin()

DAY 61

Maps and Bugs:
PROJECT 16 - PART TWO / WRAP UP
Capital Cities

Challenges:

  • Try typecasting the return value from dequeueReusableAnnotationView() so that it's an MKPinAnnotationView. Once that’s done, change the pinTintColor property to your favorite UIColor.

  • Add a UIAlertController that lets users specify how they want to view the map. There's a mapType property that draws the maps in different ways. For example, .satellite gives a satellite view of the terrain.

  • Modify the callout button so that pressing it shows a new view controller with a web view, taking users to the Wikipedia entry for that city. (TBD)

DAY 60

Maps and Bugs:
PROJECT 16 - PART ONE
Capital Cities

Learning About:

  • MKMapView

  • MKAnnotation

  • CLLocationCoordinate2D

Topics:

  • Setting Up

  • Up and Running with MapKit

  • Annotations and Accessory Views: MKPinAnnotationView

DAY 59

CONSOLIDATION VI:
MILESTONE: PROJECTS 13 - 15
Images and Animation

Topics:

  • What you learned

  • Key Points

  • Challenge

Challenges:

  • Challenge is to make an app that contains facts about countries: show a list of country names in a table view, then when one is tapped bring in a new screen that contains its capital city, size, population, currency, and any other facts that interest you. The type of facts you include is down to you.

DAY 58

Images and Animation:
PROJECT 15 - PART TWO / WRAP UP
Animation

Challenges:

  • Go back to project 8 and make the letter group buttons fade out when they are tapped. We were using the isHidden property, but you'll need to switch to alpha because isHidden is either true or false, it has no animatable values between.

  • Go back to project 13 and make the image view fade in when a new picture is chosen. To make this work, set the alpha to 0 first.

  • Go back to project 2 and make the flags scale down with a little bounce when pressed.

DAY 57

Images and Animation:
PROJECT 15 - PART ONE
Animation

Learning About:

  • animate(withDuration:)

  • CGAffineTransform

  • Alpha

Topics:

  • Setting Up

  • Preparing for Action

  • Switch, Case, Animate: animate(withDuration:)

  • Transform: CGAffineTransform

DAY 56

Images and Animation:
PROJECT 14 - PART TWO / WRAP UP
Whack-A-Penguin

Learning About:

  • SKAction Sequences

Topics:

  • Whack to Win: SKAction Sequences

  • Wrap Up

  • Challenge

Challenges:

  • Record your own voice saying "Game over!" and have it play when the game ends. (I’ve used pre recored sound)

  • When showing “Game Over” add an SKLabelNode showing their final score.

  • Use SKEmitterNode to create a smoke-like effect when penguins are hit.

DAY 55

Images and Animation:
PROJECT 14 - PART ONE
Whack-A-Penguin

Learning About:

  • SKCropNode

  • SKTexture

Topics:

  • Setting Up

  • Getting Up and Running: SKCropNode

  • Penguin, Show Thyself: SKAction moveBy(x:y:duration:)

DAY 54

Images and Animation:
PROJECT 13 - PART THREE / WRAP UP
Instafilter

Challenges:

  • Try making the Save button show an error if there was no image in the image view.

  • Make the Change Filter button change its title to show the name of the currently selected filter.

DAY 53

Images and Animation:
PROJECT 13 - PART TWO
Instafilter

Learning About:

  • UISlider

  • Practicing UIImagePickerController

Topics:

  • Setting Up

  • Designing the Interface

  • Importing a Picture

DAY 52

Images and Animation:
PROJECT 13 - PART ONE
Instafilter

Learning About:

  • UISlider

  • Practicing UIImagePickerController

Topics:

  • Setting Up

  • Designing the Interface

  • Importing a Picture

DAY 51

EXPANDING YOUR HORIZONS
Video Session

Learning About:

  • map()

  • flatMap()

  • filter()

Topics:

  • Elements of Functional Programming

  • Teaching Swift at Scale:

DAY 50

MILESTONE: PROJECTS 10 - 12

NEED HELP

Topics:

  • What you learned

  • Key Points

  • Challenge

Challenges:

  • Your challenge is to put two different projects into one: I’d like you to let users take photos of things that interest them, add captions to them, then show those photos in a table view. Tapping the caption should show the picture in a new view controller, like we did with project 1. So, your finished project needs to use elements from both project 1 and project 12, which should give you ample chance to practice.

    This will require you to use the picker.sourceType = .camera setting for your image picker controller, create a custom type that stores a filename and a caption, then show the list of saved pictures in a table view. Remember: using the camera is only possible on a physical device.

DAY 49

PROJECT 12 - PART TWO / WRAP UP
UserDefaults

Learning About:

  • Codable

Topics:

  • Fixing Project 10: Codable

  • Wrap Up

  • Review for Project 12: UserDefaults

Challenges:

  • Modify project 1 so that it remembers how many times each storm image was shown – you don’t need to show it anywhere, but you’re welcome to try modifying your original copy of project 1 to show the view count as a subtitle below each image name in the table view.

  • Modify project 2 so that it saves the player’s highest score, and shows a special message if their new score beat the previous high score.

  • Modify project 5 so that it saves the current word and all the player’s entries to UserDefaults, then loads them back when the app launches.

DAY 48

SPRITEKIT:
PROJECT 12 - PART ONE
UserDefults

Learning About:

  • UserDefaults

  • NSCoding

Topics:

  • Setting Up

  • Reading and Writing Basics: User Defaults

  • Fixing Project 10: NSCoding

DAY 47

SPRITEKIT:
PROJECT 11 - PART THREE / WRAP UP
Pachinko

Learning About:

  • SKEmitterNode

Topics:

  • Special Effects: SKEmitterNode

  • Wrap Up

  • Review for Project 11: Pachinko

Challenges:

  • The pictures we’re using in have other ball pictures rather than just “ballRed”. Try writing code to use a random ball color each time they tap the screen.

  • Right now, users can tap anywhere to have a ball created there, which makes the game too easy. Try to force the Y value of new balls so they are near the top of the screen.

  • Give players a limit of five balls, then remove obstacle boxes when they are hit. Can they clear all the pins with just five balls? You could make it so that landing on a green slot gets them an extra ball.

DAY 46

SPRITEKIT:
PROJECT 11 - PART TWO
Pachinko

Learning About:

  • SKAction

  • SKPhyisicsContactDelegate

  • SKLabelNode

Topics:

  • Spinning slots: SKAction

  • Collision detection: SKPhysicsContactDelegate

  • Scores on the board: SKLabelNode

DAY 45

SPRITEKIT:
PROJECT 11 - PART ONE
Pachinko

Learning About:

  • SKSpriteNode

  • SKPhysicsBody

  • UITouch

Topics:

  • Setting Up

  • Falling boxes: SKSpriteNode, UITouch, SKPhysicsBody

  • Bouncing balls: circleOfRadius

DAY 44

PROJECT 10 - PART THREE / WRAP UP
Names to Faces

Challenges:

  • Add a second UIAlertController that gets shown when the user taps a picture, asking them whether they want to rename the person or delete them.

  • Try using picker.sourceType = .camera when creating your image picker, which will tell it to create a new image by taking a photo. This is only available on devices (not on the simulator) so you might want to check the return value of UIImagePickerController.isSourceTypeAvailable() before trying to use it!

DAY 43

PROJECT 10 - PART TWO
Names to Faces

Learning About:

  • UIImagePickerController

  • NSObject

  • Universally Unique Identifier (UUI)

Topics:

  • Importing photos with UIImagePickerController

  • Custom subclasses of NSObject

  • Connecting up the people

DAY 42

PROJECT 10 - PART ONE
Names to Faces

Learning About:

  • UICollectionView

  • UICollectionViewCell

Topics:

  • Setting Up

  • Designing UICollectionView Cells

  • UICollectionView data sources

DAY 41

CODABLE + BUTTONS + GCD:
MILESTONE: PROJECTS 07 - 09

NEED TO COMEBACK TO THIS

Topics:

  • What you learned

  • Key Points

  • Challenge

Topics:

  • make a hangman game using UIKit. As a reminder, this means choosing a random word from a list of possibilities, but presenting it to the user as a series of underscores. So, if your word was “RHYTHM” the user would see “??????”.

  • The user can then guess letters one at a time: if they guess a letter that it’s in the word, e.g. H, it gets revealed to make “?H??H?”; if they guess an incorrect letter, they inch closer to death. If they seven incorrect answers they lose, but if they manage to spell the full word before that they win.

DAY 40

CODABLE + BUTTONS + GCD:
PROJECT 09 - PART TWO / WRAP UP
Grand Central Dispatch / GDC
Revisit Projects 01, 07, 08

Challenge:

  • Modify project 1 so that loading the list of NSSL images from our bundle happens in the background. Make sure you call reloadData() on the table view once loading has finished!

  • Modify project 8 so that loading and parsing a level takes place in the background. Once you’re done, make sure you update the UI on the main thread!

  • Modify project 7 so that your filtering code takes place in the background. This filtering code was added in one of the challenges for the project, so hopefully you didn’t skip it!

DAY 39

CODABLE + BUTTONS + GCD:
PROJECT 09 - PART ONE
Grand Central Dispatch / GDC
Revisit Project 07

Learning About:

  • Grand Central Dispatch

  • Quality of Service Queues

  • performSelector()

Topics:

  • Setting Up

  • Why is locking the UI bad?

  • GCD 101: async()

  • Back to the main thread: DispatchQueue.main

  • Easy GCD using performSelector(inBackground:)

DAY 38

CODABLE + BUTTONS + GCD:
PROJECT 08 - PART THREE / WRAP UP
Swifty Words

Challenge:

  • Use the techniques you learned in project 2 to draw a thin gray line around the buttons view, to make it stand out from the rest of the UI.

  • If the user enters an incorrect guess, show an alert telling them they are wrong. You’ll need to extend the submitTapped() method so that if firstIndex(of:) failed to find the guess you show the alert.

  • Try making the game also deduct points if the player makes an incorrect guess. Think about how you can move to the next level – we can’t use a simple division remainder on the player’s score any more, because they might have lost some points.

DAY 37

CODABLE + BUTTONS + GCD:
PROJECT 08 - PART TWO
Swifty Words

Learning About:

  • Adding Targets to a Button

  • Separating and Joining Strings

  • Hiding Views

To Do:

  • Loading a level and adding button targets

  • It’s play time: firstIndex(of:) and joined()

  • Property Observers: didSet

DAY 36

CODABLE + BUTTONS + GCD:
PROJECT 08 - PART ONE
Swifty Words

Learning About:

  • Text Alignment

  • Layout Margin

  • UIFont

To Do:

  • Setting Up

  • Building a UIKit User Interface Programmatically

DAY 35

CODABLE + BUTTONS + GCD:
PROJECT 07 - PART THREE / WRAP UP
Whitehouse Petitions

Review:

  • Download JSON using Swift’s Data type

  • Use Coddle protocol to convert JSON data into Swift objects defined

  • UITabBarController

  • UIStoryboard

To Do:

  • Add a Credits button to the top-right corner using UIBarButtonItem. When this is tapped, show an alert telling users the data comes from the We The People API of the Whitehouse.

  • Let users filter the petitions they see. This involves creating a second array of filtered items that contains only petitions matching a string the user entered. Use a UIAlertController with a text field to let them enter that string. This is a tough one.

  • Experiment with the HTML - this isn’t a HTML or CSS tutorial, but you can find lots of resources online to give you enough knowledge to tinker with the layout a little.

DAY 34

CODABLE + BUTTONS + GCD:
PROJECT 07 - PART TWO
Whitehouse Petitions

Learning About:

  • Injecting HTML into a web view

  • UIStoryboard

  • Adding Tabs to a Tab Bar Controller in code

To Do:

  • Rendering a Petition: loadHTMLString

  • Finishing touches: didFinishLaunchingWithOptions

DAY 33

CODABLE + BUTTONS + GCD:
PROJECT 07 - PART ONE
Whitehouse Petitions

Learning About:

  • UITabBarController

  • Data

  • Codable

To Do:

  • Setting Up

  • Creating the basic UI: UITabBarController

  • Parsing JSON using the Coddle Protocol

DAY 32

WEB VIEWS + USER INPUT + AUTO LAYOUT :
MILESTONE: PROJECTS 4 - 6
Shopping List App

Challenge:
Create an app that lets people create a shopping list by adding items to a tableView:

  • Create a tableView Cell

  • Allow users to enter free text that gets appended to the items array using UIAlertController

BONUS:

  • Restrict duplicated Items

  • Add a left bar button item that clears the shopping list

  • Delete certain items in the list without refreshing the whole list.

DAY 31

WEB VIEWS + USER INPUT + AUTO LAYOUT :
PROJECT 06 - PART TWO / WRAP UP
Word Scramble

Learning About:

  • Advanced Visual Formatting Language

  • Auto Layout Anchors

  • Auto Layout Metrics and Priorities: Constraints(withVisualFormat:)

To Do:

  • Try replacing the widthAnchor of our labels with leadingAnchor and trailingAnchor constraints, which more explicitly pin the label to the edges of its parent.

  • Once you’ve completed the first challenge, try using the safeAreaLayoutGuide for those constraints. You can see if this is working by rotating to landscape, because the labels won’t go under the safe area.

DAY 30

WEB VIEWS + USER INPUT + AUTO LAYOUT :
PROJECT 06 - PART ONE
Word Scramble

Learning About:

  • Aspect Ratio Constraints

  • Visual Format Language

  • Advanced Auto Layout

To Do:

  • Setting Up

  • Auto Layout in code: addConstraints() with Visual Format Language

DAY 29

WEB VIEWS + USER INPUT + AUTO LAYOUT :
PROJECT 05 - PART THREE / WRAP UP
Word Scramble

Challenge:

  • Disallow answers that are shorter than three letters or are just our start word. For the three-letter check, the easiest thing to do is put a check into isReal() that returns false if the word length is under three letters. For the second part, just compare the start word against their input word and return false if they are the same.

  • Refactor all the else statements we just added so that they call a new method called showErrorMessage(). This should accept an error message and a title, and do all the UIAlertController work from there.

  • Add a left bar button item that calls startGame(), so users can restart with a new word whenever they want to.

DAY 28

WEB VIEWS + USER INPUT + AUTO LAYOUT :
PROJECT 05 - PART TWO
Word Scramble

Learning About:

  • UITextChecker

  • Inserting tableView rows with animation

To Do:

  • Prepare for submission: lowercased() and IndexPath

  • Checking for valid answers

  • Or else what?

DAY 27

WEB VIEWS + USER INPUT + AUTO LAYOUT :
PROJECT 05 - PART ONE
Word Scramble

Learning About:

  • Capture lists in Swift

  • Reading from disk: contentsOfFile

  • More on tableView

  • Loading text from files

  • Asking for user input

  • More on Closures

To Do:

  • Setting Up

  • Pick a word, any word: UIAlertController

DAY 26

WEB VIEWS + USER INPUT + AUTO LAYOUT :
PROJECT 04 - PART THREE / WRAP UP
Web Browser via WebKit

Challenges:

  • If users try to visit a URL that isn’t allowed, show an alert saying it’s blocked.

  • Try making two new toolbar items with the titles Back and Forward. You should make them use webView.goBack and webView.goForward.

DAY 25

WEB VIEWS + USER INPUT + AUTO LAYOUT :
PROJECT 04 - PART TWO
Web Browser via WebKit

Learning About:

  • UIProgressView

  • Key-value Observing

To Do:

  • Monitoring Page Loads: UIToolbar and UIProgressView

  • Refactoring

DAY 24

WEB VIEWS + USER INPUT + AUTO LAYOUT :
PROJECT 04 - PART ONE
Web Browser via WebKit

Learning About:

  • WKWebView

  • Action Sheets

To Do:

  • Setting Up

  • Creating a simple Browser with WKWebView

  • Choosing a website: UIAlertController Action Sheets

DAY 23

STARTING iOS :
MILESTONE: PROJECTS 1 - 3
Consolidation Day + Challenge

Topics:

  • Review Learnings

  • Key Points

  • Challenge

DAY 22

STARTING iOS :
PROJECT 03
Social Media - Revisit Project 1

Learning About:

  • Technique Projects

  • UIActivityViewController

Challenge:

  • Try adding the image name to the list of items that are shared. The activityItems parameter is an array, so you can add strings and other things freely. Note: Facebook won’t let you share text, but most other share options will.

  • Go back to project 1 and add a bar button item to the main view controller that recommends the app to other people.

DAY 21

STARTING iOS :
PROJECT 02 - PART THREE / WRAP UP
Guess the Flag Game

Challenge:

  • Try showing the Player’s score in the navigation bar, alongside the flag to guess.

  • Keep track of how many questions have been asked, and show one final alert controller after they have answered 10. This should be their final score.

  • When Player chooses the wrong flag, tell them their mistake in your alert message and write a correct answer.

DAY 20

STARTING iOS :
PROJECT 02 - PART TWO
Guess the Flag Game

Learning About:

  • @IBAction

  • UIAlertController

To Do:

  • Guess the Flag: Random Numbers

  • From Outlet to Actions: Creating an IBAction

DAY 19

STARTING iOS :
PROJECT 02 - PART ONE
Guess the Flag Game

Learning About:

  • UIButton

  • CALayer

  • .cgColor

To Do:

  • Setting Up

  • Designing Layout

  • Making the basic game work

DAY 18

STARTING iOS :
PROJECT 01 - PART THREE / WRAP UP
Gallery

Challenge:

  • Adjust Table View text size to personal preference

  • Sort image title from 001 to 010

DAY 17

STARTING iOS :
PROJECT 01 - PART TWO
Gallery

Learning About:

  • UIImageView

  • UIImage

  • UINavigationBar

  • Etc.

To Do:

  • Building a Detailed Screen

  • Loading Images with UIImage

  • Final Tweaks: hidesBarsOnTap, Safe Area Margins

DAY 16

STARTING iOS :
PROJECT 01 - PART ONE
Gallery

Learning About:

  • View Controllers

  • Storyboards

  • FileManager

To Do:

  • Setting Up

  • Listing Images with FileManager

  • Design our Interface

DAY 15

INTRODUCTION TO SWIFT :
SWIFT REVIEW - DAY THREE

Reviewing:

  • Properties

  • Static Properties and Methods

  • Access Control

  • Polymorphism and Typecasting

  • Closures

  • Protocols

  • Extensions

  • Protocol Extensions

DAY 14

INTRODUCTION TO SWIFT :
SWIFT REVIEW - DAY TWO

Reviewing:

  • Functions

  • Optionals

  • Optional Chaining

  • Enumerations

  • Structs

  • Classes

DAY 13

INTRODUCTION TO SWIFT :
SWIFT REVIEW - DAY ONE

Reviewing:

  • Variables and Constants

  • Types of Data

  • Operators

  • String Interpolation

  • Arrays

  • Dictionaries

  • Conditional Statements

  • Loops

  • Switch Case

DAY 12

INTRODUCTION TO SWIFT :
OPTIONALS + UNWRAPPING + TYPECASTING

Learning about:

  • Handling missing data

  • Unwrapping Optionals

  • Unwrapping with Guard

  • Force Unwrapping

  • Implicitly Unwrapped Optionals

  • Nil Coalescing

  • Optional Chaining

  • Optional Try

  • Failable Initializers

  • Typecasting

DAY 11

INTRODUCTION TO SWIFT :
PROTOCOLS AND EXTENSIONS

Learning about:

  • Protocols

  • Protocol Inheritance

  • Extensions

  • Protocol Extensions

  • Protocol-Oriented Programming

DAY 10

INTRODUCTION TO SWIFT :
CLASSES AND INHERITANCE

Learning about:

  • Creating your own Classes

  • Class Inheritance

  • Overriding Methods

  • Final Classes

  • Copying Objects

  • Deinitializers

  • Mutability

DAY 09

INTRODUCTION TO SWIFT :
STRUCTS PART 2

Learning about:

  • Initializers

  • Referring to the Current Instance

  • Lazy Properties

  • Static Properties and Methods

  • Access Control

DAY 08

INTRODUCTION TO SWIFT :
STRUCTS PART 1

Learning about:

  • Creating your own Structs

  • Computed Properties

  • Property Observers

  • Methods

  • Mutating Methods

  • Properties and Methods of Strings

  • Properties and Methods of Arrays

DAY 07

INTRODUCTION TO SWIFT :
CLOSURES PART 2

Learning about:

—The least I need to know —

  • Using Closures as a Parameters when they accept Parameters

  • Using Closures as Parameters when they return Values

  • Shorthand Parameter Names

— Advanced Closures —

  • Closures with Multiple Parameters

  • Returning Closures from Functions

  • Capturing Values

DAY 06

INTRODUCTION TO SWIFT :
CLOSURES PART 1

Learning about:

  • Creating Basic Closure

  • Accepting Parameters in a Closure

  • Returning Values from a Closure

  • Closures as Parameters

  • Trailing Closure Syntax

DAY 05

INTRODUCTION TO SWIFT :
FUNCTIONS, PARAMETERS, AND ERRORS

Learning about:

  • Writing Functions()

  • Accepting Parameters

  • Returning Values

  • Parameter Labels

  • Omitting Parameter Labels

  • Default Parameters

  • Variadic Functions

  • Writing Throwing Functions

  • Running Throwing Functions

  • Inout Parameters

DAY 04

INTRODUCTION TO SWIFT :
LOOPS

Learning about:

  • For Loops

  • While Loops

  • Repeat Loops

  • Exiting Loops

  • Exiting Multiple Loops

  • Skipping Items

  • Infinite Loops

DAY 03

INTRODUCTION TO SWIFT :
OPERATORS AND CONDITIONS

Learning about:

  • Arithmetic Operators

  • Operator Overloading

  • Compound Assignment Operators

  • Comparison Operators

  • Conditions

  • Combining Conditions

  • The Ternary Operator

  • Switch Statements

  • Range Operators

DAY 02

INTRODUCTION TO SWIFT :
COMPLEX TYPES

Learning about:

  • Arrays

  • Sets

  • Tuples

  • Arrays VS Sets VS Tuples

  • Dictionaries

  • Dictionary default values

  • Creating empty collections

  • Enumerations

  • Enum associated values

  • Enum raw values

DAY 01

INTRODUCTION TO SWIFT :
SIMPLE TYPES

Learning about:

  • Variables

  • Strings and Integers

  • Multi-line Strings

  • Double and Booleans

  • String Interpolation

  • Constants

  • Type Annotations