I’m using the example in the final chapter as the basis for an app that has a split view controller as the root. The master view contains a table and I want the item selected by the user to drive activity in the detail view. The detail view contains a tab bar controller; each of its tabs provides the user with a selection of data derived from the item they chose.
It would seem logical for the viewModel associated with the table to expose the selected Object using a Driver and then bind this to the inputs (AnyObservable) of the viewModels associated with each of the tabs of the tab bar controller. The binding would occur in Scene enum (I’ll need to modify the signatures a bit but that doesn’t seem hard on the face of it). Would this be good practice and/or the best solution? Another possibility is to give the UITabBarController its own viewModel, bind to the tableview and then bind this to each of the tabs.
BTW, the viewModel type has been modified slightly using internal/associated Structs to clearly identify inputs, outputs and actions - doesn’t make any difference to functionality but stops me getting confused!
Ideas, guidance or comments would be greatly appreciated