RxSwift + RxRealm + RxRealmDataSources , get the index's value and pass to the next VC

Now I'm practicing build project with Rxswift+MVVM The firstVC has a collectionView,when user click the cell, and then get the caseId(in the Case model),finally pass to the next VC. I import the RxRealm+RxRealmDataSources to setup my collectionView.


final class ViewModel: ViewModelType {
    struct Input {
        let cellDidSelect: Observable<Void> // Click the cell
    struct Output {
        let cases: Results<Case> // FirstVC's Realm objects
        let caseId: Observable<Int> // Get the caseId from the cell
    func transform(input: Input) -> Output {
        let cases = IHRealm.sharedInstance.objects(Case.self)
        let cellIndex = input.cellDidSelect
            .flatMapLatest{ ?? } 
        return Output(cases: cases, caseId: cellIndex)

My problem is:

(1)What do I put in the flatMapLatest(or other method) and the can get the cell's value?

(2)It's any wrong with my viewModel? caseId: Observable<Int> in the Output is correct?