# 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.

5:19

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…

5:25

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…

6:46

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…

7:40

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…

7:48

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…

8:34

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…

7:31

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…

7:05

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…

6:31

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.

7:17

1. WeSplit

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

38:12

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

16:29

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…

5:33

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…

18:36

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…

6:53

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…

7:42

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…

7:24

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…

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…

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…

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…

22:07

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

16:46

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…

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…

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…

14:19

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…

22:55

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…

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…

10:30

19. Bucket List

This challenge asks you to figure out a modifier conundrum, show alerts for authentication errors, and create a view model for `EditView`. Let’s tackle it now…

11:58

This challenge asks you to make decorative decorations, make the rows in iExpense read more smoothly with VoiceOver, then conduct your own review of Moonshot and fix it up. Let’s tackle it now…

14:32

This challenge asks you to add an icon to show which prospects have been contacted, to use the documents directory for saving and loading data, and to enable custom sorting for the data. Let’s tackle it now…

27:45

22. Flashzilla

This challenge asks you to clear the text fields after adding a card, avoid red flashes when changing your mind about a correct card, and reinsert wrong answers back into the deck. Let’s tackle it now…

7:30

This challenge asks you make views fade out, scale down, and change their color, all synchronized with the movement in our `ScrollView`. Let’s tackle it now…

36:20

24. High Rollers

This challenge asks you build an app that simulates random dice rolls on behalf the user, adding haptic feedback to bring it to life, and permanent storage for later reference. Let’s tackle it now…

11:42

25. SnowSeeker

This challenge asks you add a photo credit to resort images, handle loading and saving of favorite resorts, then add sorting options to the main listing. Let’s tackle it now…