Skip to content

Instantly share code, notes, and snippets.

@chriseidhof
Created October 24, 2019 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriseidhof/c3879de6b9197c544c69a0e03e42240c to your computer and use it in GitHub Desktop.
Save chriseidhof/c3879de6b9197c544c69a0e03e42240c to your computer and use it in GitHub Desktop.
//
// ContentView.swift
// OptionalViews
//
// Created by Chris Eidhof on 24.10.19.
// Copyright © 2019 objc.io. All rights reserved.
//
import SwiftUI
struct Foo: View {
@Environment(\.self) var env
var body: some View {
dump(env)
return Text("Hello")
}
}
struct ContentView: View {
var body: some View {
let view =
Foo()
.foregroundColor(.red)
dump(view)
return view
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment