In this code I am creating a reference to the GameViewModel
class which extends the ViewModel
class
I know why we are delegating the responsibility to viewModels()
but I want to know what actually is this viewModels
and how it is different from ViewModel
private val viewModel: GameViewModel by viewModels()
You compare kotlin delegate function( by viewModels()) and ViewModel class together, open sources i think that will help you better understand.