Let me put it another way... somewhere in your app, you are creating a CVC, and when this happens, you get the error. So where does this happen, and how. Where do you create/instantiate/initialize the CVC?
You have not shown an initialization of CVC. Maybe it in initialized using a Storyboard segue? In that case, you could make viewModel an Optional, and set it in the prepare for segue method.
Let me put it another way... somewhere in your app, you are creating a CVC, and when this happens, you get the error. So where does this happen, and how. Where do you create/instantiate/initialize the CVC?
You have not shown an initialization of CVC. Maybe it in initialized using a Storyboard segue? In that case, you could make viewModel an Optional, and set it in the prepare for segue method.