![thumbnail](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FSZHKl%2FbtrqAV8yo3t%2Fl2VzPnHKc9Oh1VxiNrHRU1%2Fimg.png)
[Android/Kotlin] ViewModel 이란? (+ LiveData 포함)
2022. 1. 14. 10:06
Mobile/Android
LiveData의 정의 ViewModel은 그 내부에서 LiveData를 사용하고 있다. 그러므로 우선 LiveData에 대해서 알아보고자 한다. 안드로이드 개발자 공식 홈페이지에서 설명하고 있는 LiveData는 아래와 같이 정의되어 있다. (링크) LiveData is a data holder class that can be observed within a given lifecycle. This means that an Observer can be added in a pair with a LifecycleOwner, and this observer will be notified about modifications of the wrapped data only if the paired LifecycleO..