Day 36. Project 7, part 1
https://www.hackingwithswift.com/100/swiftui/36
100 Days of SwiftUI – Day 36 – Hacking with Swift
Link copied to your pasteboard.
www.hackingwithswift.com
오늘은 Naviagation과 View 간의 data 공유, UserDefaults와 Codable에 대해 간략하게 다룹니다. ObservableObject을 ObservedObject로 선언한 다음, View들이 그냥 나눠갖는다고 하니... 간단한 것 같으면서도 대체 MVC나 MVVM으로 어떻게 구현해야할지 바로 떠오르지가 않습니다. @Environment(\.presentationMode)도 내부 구현이 궁금해집니다. 문서에 의하면 presentationMode 뿐만 아니라 font, imageScale, pixelLength, lineSpacing 등 별의별걸 다 들고 있습니다. App이 하나 갖고 있는 건지, View 마다 지정해서 가질 수 있는 건지 지금은 알 수 없네요.
https://developer.apple.com/documentation/swiftui/environmentvalues
EnvironmentValues - SwiftUI | Apple Developer Documentation
Structure EnvironmentValues A collection of environment values propagated through a view hierarchy. Declaration See AlsoEnvironment Data
developer.apple.com