Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Persistent store Coordinator
- Swift LinkedList
- CoreData Stack
- expensive operation
- leetcode #01
- Java
- Swift 고차함수
- persistentStoreCoordinator
- Raw value and Associated value
- NSManagedObject SubClass
- iOS Static Library
- 트레일링 클로저
- NSPredicates
- Swift
- 다익스트라 이해
- CoreData
- Clean swift
- Associated Value
- Swift closure
- 2022 부스트캠프
- NSSortDescriptor
- iOS Static Library 사용하는방법
- 1009번
- 스위프트 클로저
- codability
- CoreData Concurrency
- LightWeight Migration
- CoreData Filter
- 일급 객체
- dateFormatter
Archives
- Today
- Total
하루를살자
SwiftUI Architecture - MVVM (Model, View, and ViewModel) 본문
Model = Structures and Classes that represent the data objects in the application.
View = Represents the UI to the user and captures interaction. Uses the ViewModel to know what to show.
ViewModel = Manages the state and data that your view portrays. Contains business logic and code to carry out functions of the application
How to get updated with the change in data from the view?
1. The ObservableObject Protocol
--> declare "ObserableObject" protocol to ViewModel class
2. Add @ObservedObject keyword on the View at the class instantiation line
3. Specify property of ViewModel that is to be broadcasted
--> add @Pusblished keyword in front of the property
'Swift' 카테고리의 다른 글
Swift 고차함수 (0) | 2022.02.05 |
---|---|
Swift - Collection Types (0) | 2022.01.01 |
Swift - Enum (0) | 2021.12.31 |
Swift - Optionals (0) | 2021.12.21 |
Swift Basics - Playground(Xcode), Data type, Function (0) | 2021.12.17 |
Comments