title: Can't delete cell from tableview using rxdatasources swift
body: <p>I have an tableview where I populate some data from view model, I am using RxSwift and RxDataSources... I have next code</p>
  
  <pre><code>  enum TableViewEditingCommand {
      case DeleteItem(IndexPath)
    }
  
  struct SectionedTableViewState {
      fileprivate var sections: [MySectionViewModel]
  
      init(sections: [MySectionViewModel]) {
          self.sections = sections
      }
  
      func execute(command: TableViewEditingCommand) -&gt; SectionedTableViewState {
          switch command {
  
          case .DeleteItem(let indexPath):
  
              var sections = self.sections
              var items = sections[indexPath.section].items
  
              items.remove(at: indexPath.row)
              sections[indexPath.section] = MySectionViewModel(original: sections[indexPath.section], items: items)
              return SectionedTableViewState(sections: sections)
          }
      }
  }
  </code></pre>
  
  <p>my view controller has something like this</p>
  
  <pre><code>    class MyViewController : UIViewController { 
         let dataSource = RxTableViewSectionedAnimatedDataSource&lt;MySectionViewModel&gt;()
  
        override func viewDidLoad() {
              super.viewDidLoad() 
  
         viewModel.findElements()
                  .bindTo(tableView.rx.items(dataSource:dataSource))
                  .addDisposableTo(disposeBag)
  
       dataSource.configureCell = { datasource, tableView, indexPath, item in
           .... my configuration
        }
  
    dataSource.canEditRowAtIndexPath = { _ in true}
  
    let deleteCommand = tableView.rx.itemDeleted.asObservable()
              .map(TableViewEditingCommand.DeleteItem)
  
    let initialState = SectionedTableViewState(sections:dataSource.sectionModels)
  
  Observable.of(deleteCommand)
              .merge()
              .scan(initialState) { (state: SectionedTableViewState, command: TableViewEditingCommand) -&gt; SectionedTableViewState in
                  return state.execute(command: command)
              }
              .startWith(initialState)
              .map {
                  $0.sections
              }
              .shareReplay(1)
              .bindTo(tableView.rx.items(dataSource: dataSource))
              .addDisposableTo(disposeBag)
  
  
  }
  
  
  
      }
  </code></pre>
  
  <p>seems like in this line</p>
  
  <pre><code>let initialState = SectionedTableViewState(sections:dataSource.sectionModels)
  </code></pre>
  
  <p>sections is an empty array, because I get an index out range exception and when I print array, it has not any elements. My question is how can I get sections from datasource?</p>
  
  <p>I've seen the example from this url: 
   <a href="https://github.com/RxSwiftCommunity/RxDataSources/blob/master/Example/Example3_TableViewEditing.swift" rel="nofollow noreferrer">https://github.com/RxSwiftCommunity/RxDataSources/blob/master/Example/Example3_TableViewEditing.swift</a></p>
  
  <p>Thanks in advance.</p>