100-days-of-swiftui-and-com.../day-096
CypherPoet 922337f7e6 Begin implementing Pad details view. 2020-01-28 20:10:15 -06:00
..
Projects Begin implementing Pad details view. 2020-01-28 20:10:15 -06:00
README.md Complete Day 96 2020-01-26 05:11:59 -06:00

README.md

Day 96: Project 19: SnowSeeker (Part One)

Follow along at https://www.hackingwithswift.com/100/swiftui/96.


📒 Field Notes

This day covers Part One of Project 19 in the 100 Days of SwiftUI Challenge.

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