Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SwiftUI Environment Object
struct MainView: View {
@StateObject var prices = Prices()
var body: some View {
VStack {
PricesView()
}.environmentObject(prices)
}
}
struct PricesView: View {
@EnvironmentObject var prices: Prices
//
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment