Solutions

This section provides hands-on walkthroughs for various challenges you'll find elsewhere in my work.

Swift for Complete Beginners

Solutions for the checkpoint challenges you'll encounter as you're learning.

Checkpoint 1

5:19

1. Checkpoint 1

Checkpoint 1 of Swift for Complete Beginners asks you to create an Xcode playground able to convert any value of Celsius into Fahrenheit, then print the result. Let’s solve that now…

Checkpoint 2

5:25

2. Checkpoint 2

Checkpoint 2 of Swift for Complete Beginners asks you to print the number of items in a string array, then print the number of unique items. Let’s solve that now…

Checkpoint 3

6:46

3. Checkpoint 3

Checkpoint 3 of Swift for Complete Beginners asks you to tackle the classic FizzBuzz problem, printing Fizz, Buzz, FizzBuzz, or a number depending on the input. Let’s solve that now…

Checkpoint 4

7:40

4. Checkpoint 4

Checkpoint 4 of Swift for Complete Beginners asks you to find the integer square root an input number within a certain range, or throw errors if you can’t do it. Let’s solve that now…

Checkpoint 5

7:48

5. Checkpoint 5

Checkpoint 5 of Swift for Complete Beginners asks you to process an array of numbers using filter(), sorted(), and map(). Let’s solve that now…

Checkpoint 6

8:34

6. Checkpoint 6

Checkpoint 6 of Swift for Complete Beginners asks you to create a struct to model a car, adding properties and methods that make sense. Let’s solve that now…

Checkpoint 7

7:31

7. Checkpoint 7

Checkpoint 7 of Swift for Complete Beginners asks you to create a class hierarchy to store various types of animals, including properties, methods, and initializers. Let’s solve that now…

Checkpoint 8

7:05

8. Checkpoint 8

Checkpoint 8 of Swift for Complete Beginners asks you to design a protocol to represent a building, then create two structs conforming to it. Let’s solve that now…

Checkpoint 9

6:31

9. Checkpoint 9

Checkpoint 9 of Swift for Complete Beginners asks you to write a function to pick a number from an optional array, or return a random number if that’s not possible. Let’s solve that now…

100 Days of SwiftUI

Solutions for the challenges and milestones you'll encounter as you're learning.

WeSplit

7:17

1. WeSplit

There are three challenges for WeSplit, including adding section headers and showing a grand total. Let’s solve them now…

Challenge 1: Converter

38:12

2. Challenge 1: Converter

This early challenge day asks you to build a converter app that’s able to move between any two similar units, such as kilometers and miles. Let’s solve it now, then we’ll take it further, and then we’ll take it even further

Guess the Flag

16:29

3. Guess the Flag

This challenge asks you to add some important features to Guess the Flag, including a score tracker and a limited number of questions. Let’s solve those now, and tackle a bonus problem at the end just for fun…

Views and Modifiers

5:33

4. Views and Modifiers

This challenge asks you to back and adjust both project 1 and project 2 based on what you learned, then try your hand at creating a custom view modifier. Let’s tackle it now…

Rock, Paper, Scissors

18:36

5. Rock, Paper, Scissors

This challenge asks you to build a fun brain game using all the SwiftUI skills you’ve learned so far. Let’s tackle it now…

BetterRest

6:53

6. BetterRest

This challenge asks you to adjust the BetterRest user interface to have sections, a picker, and an always-present bedtime calculation. Let’s tackle it now…

Word Scramble

7:42

7. Word Scramble

This challenge asks you to disallow certain words, let users start a new game whenever they want, and also track player scores. Let’s tackle it now…

Animations

7:24

8. Animations

This challenge asks you to add three different animations to the Guess the Flag game from project 2: spinning, fading, and one of your choosing. Let’s tackle it now…

iExpense

17:40

9. iExpense

This challenge asks you to support the user’s preferred currency symbol, style your expenses somehow, then split the list into two sections. Let’s tackle it now…

Moonshot

18:21

10. Moonshot

This challenge asks you to add some extra text to the mission view, break up at least two SwiftUI views, then, for something harder, allow the user to move between a grid and a list for missions. Let’s tackle it now…

Drawing

16:27

11. Drawing

This challenge asks you to add create a custom arrow shape, make it animatable, then create a color cycling rectangle with controls for gradient angle. Let’s tackle it now…

Habit tracking

22:07

12. Habit tracking

This challenge asks you to create a habit-tracking app, optionally with Codable support and completion count. Let’s tackle it now…

Cupcake Corner

16:46

13. Cupcake Corner

This challenge asks you to upgrade the form validation, add a user-facing error, then switch our data model over to be a struct rather than a class. But rather than just leave it there, I’m going to sneak in a little bonus about Swift keypaths – let’s tackle it now…

Bookworm

4:29

14. Bookworm

This challenge asks you to make sure all book data is provided, to highlight bad books somehow, and to show a date for when each book was read. Let’s tackle it now…

Core Data

12:43

15. Core Data

This challenge asks you to adjust FilteredList in three ways: make it accept a string predicate, make it accept an enum predicate, then make it accept an array of sort descriptors for the managed object it uses. Let’s tackle it now…

Friendface, part 1

14:19

16. Friendface, part 1

This challenge asks you to create an app that downloads and decodes JSON from the internet, then shows it in a list. Let’s tackle it now…

Friendface, part 2

22:55

17. Friendface, part 2

This challenge asks you to upgrade our simple Friendface app to make it store a Core Data cache of data, so it works just as well offline as online. Let’s tackle it now…

Instafilter

11:39

18. Instafilter

This challenge asks you to make our Save button work better, add more sliders to control effects, and add three extra filters of your choice. Let’s tackle it now…