title: Binding an RxSwift Observable to an array
body: <p>Trying out RxSwift and trying to convert my network calls. I can't seem to display my data in the view because im not sure how I convert my observable to something my views can use. Here's an example of my request:</p>
  
  <pre><code>class SomeService {
  
      let provider = Provider()
      func getData() -&gt; Observable&lt;[Object]?&gt; { // Returns json
          return provider
              .request(.getSomething())
              .debug()
              .mapArrayOptional(type: Object.self) 
              // Using Moya_Modelmapper map each item in the array
      }
  
  }
  </code></pre>
  
  <p>In my view controller I get the data: </p>
  
  <pre><code> let data = Service.getData()
   print(data) ... &lt;Swift.Optional&lt;Swift.Array&lt;MyApp.Item&gt;&gt;&gt;
  </code></pre>
  
  <p>I have tried to subscribe to the response to the sequence but I don't know how I actually convert it to something like an array I can use in my view.</p>
  
  <p><strong>UPDATE:</strong> With answer implemented:   </p>
  
  <pre><code>    func itemsObserver() {
          print("Time to print step 1") // This gets printed
          data
          .filter { $0 != nil }.map { $0! }
          .subscribe(
              onNext: { objects in
                  print(objects as Any) 
                  print("Step 2") // This does not get executed at all
              },
              onCompleted:{ objects in
                  print(objects as Any) // This is ()
                  print("Complete") // This gets printed
              }
              ).addDisposableTo(disposeBag)
      }
      itemsObserver()
  </code></pre>
  
  <p><strong>Console output:</strong> </p>
  
  <pre><code> Time to print step 1
   Service.swift:21 (getData()) -&gt; subscribed
   Service.swift:21 (getData()) -&gt; Event next(Status Code: 200, Data Length: 141)
   Service.swift:21 (getData()) -&gt; Event completed
   Service.swift:21 (getData()) -&gt; isDisposed
   ()
   Complete
  </code></pre>