상세 컨텐츠

본문 제목

Day 36. Project 7, part 1

TIL/#100DaysOfSwiftUI

by box-jeon 2020. 3. 22. 23:03

본문

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

 

'TIL > #100DaysOfSwiftUI' 카테고리의 다른 글

Day 38. Project 7, part 3  (0) 2020.03.24
Day 37. Project 7, part 2  (0) 2020.03.23
Day 35. Milestone: Projects 4-6  (0) 2020.03.21
Day 34. Project 6, part 3  (0) 2020.03.21
Day 33. Project 6, part 2  (0) 2020.03.19

관련글 더보기

댓글 영역