Created
October 24, 2019 09:23
-
-
Save chriseidhof/c3879de6b9197c544c69a0e03e42240c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// 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