WWDC19

Table of Contents

=================

SwiftUI Essentials - Wednesday

Session materials: https://developer.apple.com/videos/play/wwdc2019/216/

Views and Modifiers

Building Custom Views

class Foo: UIView {}

Composing Controls

Form {
  Section
    content
    content
  Section
    content
}

for form styled views with specific sections which has their own set of cells automatically

Button(action: action) {
  VStack {
    content
    content
  }
}

to have a highly customized button with vertically aligned content

Adaptive Controls

Toggle

Control Modifiers

Form {
  Section {
    Toggle(isOn)
    .disabled()
  }
}
.accentColor() // Form wide accent color
.disabled() // Form wide disabling rather than single disabling

Environment Variables

struct ContentView: View {
    var body: some View {
      NavigationView { // Standard navigation
       OrderForm()
      }
    }
}

struct OrderForm: View {
    var body: some View {
      NavigationButton(destination: ANOTHER_VIEW)
    }
}