title: RxSwift, how do I chain different observables
body: <p>I am still a beginner in Reactive programming, and RxSwift in general.
  I want to chain two different operation. In my case I simply want to download a zip file from a web server, and then unzip it locally.
  I also want, at the same time to show the progress of the downloaded files.
  So I started creating the first observable:</p>
  
  <pre><code> class func rx_download(req:URLRequestConvertible, testId:String) -&gt; Observable&lt;Float&gt; {
  
      let destination:Request.DownloadFileDestination = ...
  
      let obs:Observable&lt;Float&gt; = Observable.create { observer in
         let request =  Alamofire.download(req, destination: destination)
          request.progress { _, totalBytesWritten, totalBytesExpectedToWrite in
              if totalBytesExpectedToWrite &gt; 0 {
                  observer.onNext(Float(totalBytesWritten) / Float(totalBytesExpectedToWrite))
              }
              else {
                  observer.onNext(0)
              }
          }
          request.response {  _, response, _, error in
              if let responseURL = response {
                  if responseURL.statusCode == 200 {
                      observer.onNext(1.0)
                      observer.onCompleted()
                  } else  {
                      let error = NSError(domain: "error", code: responseURL.statusCode, userInfo: nil)
                      observer.onError(error)
                  }
              } else {
                  let error = NSError(domain: "error", code: 500, userInfo: nil)
                  observer.onError(error)
              }
  
              }
              return AnonymousDisposable () {
                  request.cancel()
              }
          }
      return obs.retry(3)
  
  }
  </code></pre>
  
  <p>After that, I create a similar function for the unzip</p>
  
  <pre><code>class func rx_unzip(testId:String) -&gt; Observable&lt;Float&gt; {
      return Observable.create { observer in
          do {
              try Zip.unzipFile(NSURL.archivePath(testId), destination: NSURL.resourceDirectory(testId), overwrite: true, password: nil)
                  {progress in
                      observer.onNext(Float(progress))
                  }
          } catch let error {
              observer.onError(error)
          }
          observer.onCompleted()
          return NopDisposable.instance
      }
  }
  </code></pre>
  
  <p>For now I have this logic on the "View model layer", so I download-> subscribe on completed-> unzip</p>
  
  <p>What I want is to combine the two Observable in one, in order to perform the download first, then on completed unzip the file. Is there any way to do this? </p>