Complete Day 96

This commit is contained in:
CypherPoet 2020-01-26 05:11:59 -06:00
parent b476d447e5
commit b7d7d36fee
2 changed files with 46 additions and 1 deletions

View File

@ -101,12 +101,13 @@ I'm currently seeking freelance, remote opportunities as an iOS developer! If yo
- **Day 92:** [_Project 18: Layout And Geometry (Part One)_](./day-092/)
- **Day 93:** [_Project 18: Layout And Geometry (Part Two)_](./day-093/)
- **Day 94:** [_Project 18: Layout And Geometry (Part Three)_](./day-094/)
- **Day 95:** [Milestone for Projects 16-18](./day-095/)
</details>
**Latest Day:**
- **Day 95:** [Milestone for Projects 16-18](./day-095/)
- **Day 96:** [_Project 19: SnowSeeker (Part One)_](./day-096/)

44
day-096/README.md Normal file
View File

@ -0,0 +1,44 @@
# Day 96: _Project 19: SnowSeeker_ (Part One)
_Follow along at https://www.hackingwithswift.com/100/swiftui/96_.
<br/>
# 📒 Field Notes
This day covers Part One of _`Project 19`_ in the [100 Days of SwiftUI Challenge](https://www.hackingwithswift.com/100/swiftui/96).
It focuses on several specific topics:
- SnowSeeker: Introduction
- Working with two side by side views in SwiftUI
- Using alert() and sheet() with optionals
- Using groups as transparent layout containers
## SnowSeeker: Introduction
From the project description:
> In this project were going to create SnowSeeker: an app to let users browse ski resorts around the world.
>
> ...
>
> This will be the first app where we specifically aim to make something that works great on iPad by showing two views side by side, but youll also get deep into solving problematic layouts, learn a new way to show sheets and alerts, and more.
## Working with two side by side views in SwiftUI
SwiftUI doesn't have a direct equivalent of UIKit's `UISplitViewController`, but, instead, relies on defining the structure of the `NavigationView` and having the system handle the "splitting" depending on the layout of the device.
## Using alert() and sheet() with optionals
Sometimes we want to show an alert or sheet if a Boolean value is true. Sometimes we want to show it if a value exists altogether. (Side note: This is why Optionals can be useful in general 🙂).
Thankfully, SwiftUI gives us a version of the `alert` or `sheet` modifiers that can bind to the existence of an `Identifiable` Optional. Much more useful than driving a Boolean with side-effects 💪.