How to register show 2 custom cells alternately with RxSwift

items.asObservable()
    .bindTo(tableView.rx.items) { (tableView, row, element) in
        let indexPath = IndexPath(row: row, section: 0)

        if row % 2 == 0 {
            // or some other logic to determine which cell type to create

            let cell = tableView.dequeueReusableCell(withIdentifier: LeftTableViewCell.reuseIdentifier, for: indexPath) as! LeftTableViewCell
            // Configure the cell
            return cell
        }
        else {
            let cell = tableView.dequeueReusableCell(withIdentifier: RightTableViewCell.reuseIdentifier, for: indexPath) as! RightTableViewCell
            // Configure the cell
            return cell
        }

    }
    .disposed(by: disposeBag)