์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- BFS
- RxSwift
- XCTest
- ios
- combine
- Swfit
- TCA
- Kuring
- UIKit
- arkit
- MVVM
- ๋ฐฑ์ค
- ํ๋ก๊ทธ๋๋จธ์ค
- ํจ์คํธ์บ ํผ์ค
- tableView
- Flutter
- swift
- designpattern
- visionOS
- CollectionView
- node.js
- Xcode
- SwiftUI
- BOJ
- SnapKit
- realm
- Lv2
- rxcocoa
- reactorkit
- raywenderlich
Archives
- Today
- Total
๋ชฉ๋กEnvironmentObject (1)
lgvv98
[SwiftUI 3.0] State/ Binding / EnvironmentObject
State/ Binding / EnvironmentObject โ ์ค๋์ ์ด ์ธ๊ฐ์ง์ ๋ํด์ ์์๋ณด์. @State: ๊ฐ์ด ๋ณ๊ฒฝ๋์์ ๋, ํ๋ฉด์ ๋ค์ ๋ณด์ฌ์ฃผ์ด์ผ ํ ๋. @Binding: state๊ฐ์ ์น๊ตฌ๋ค์ view - view ๊ฐ์ ๊ณต์ ํด์ผ ํ๋ ๊ฒฝ์ฐ. @EnvironmentObject: parent๋ก child(ํ์) view์ ๊ณต์ ํด์ผ ํ๋ ๊ฒฝ์ฐ. ์ฐ์ State์ Binding์ ๋ํด์ ์ดํดํด๋ณด์. โ ์์ ์ฝ๋ struct FirstView: View { @State var appTitle = tabIndex.first.rawValue @State var count = 0 enum tabIndex: String { case first = "1๋ฒ๋ทฐ ์ ๋๋ค." case second = "2๋ฒ๋ทฐ..
apple/๐ SwiftUI & Combine
2022. 5. 19. 15:10