title: Can a signal observer get access to the last emitted value of a ReactiveCocoa signal?
body: <p>I'm starting using ReactiveCocoa and I'm still struggling with some basic concepts:</p>
  
  <ol>
  <li>My app starts listening for geolocation data (<code>init</code> in my view model)</li>
  <li>My app emits a signal with my current location (<code>didFindCurrentPosition</code> is called)</li>
  <li>My view controller showing a map loads (<code>viewDidLoad</code> in my view controller)</li>
  <li>My view controller starts observing the current location signal (still <code>viewDidLoad</code>)</li>
  </ol>
  
  <p>My problem is: after step 2 is achieved, if no other event is sent on the signal, my view controller doesn't get notified. </p>
  
  <p>How can my view controller get access to the last value from the signal? (ie how to get access at step 3 to a value emitted at step 2?)</p>
  
  <p>Thanks for your help.</p>
  
  <p><em>PS: ReactiveCocoa looks like a great library but I'm puzzled by the state of the documentation. IMHO, it is not very clear and lacks some clear guides on how to use it.</em></p>
  
  <h2>The Code</h2>
  
  <p>The view model:</p>
  
  <pre><code>class MyViewModel: LocationManagerDelegate {
      let locationManager: LocationManager
      let geolocationDataProperty = MutableProperty&lt;Geolocation?&gt;(nil)
      let geolocationData: Signal&lt;Geolocation?, NoError&gt;
  
      init() {
          geolocationData = geolocationDataProperty.signal
  
          // Location Management
          locationManager = LocationManager()
          locationManager.delegate = self
          locationManager.requestLocation()
      }
  
      // MARK: - LocationManagerDelegate
  
      func didFindCurrentPosition(location: CLLocation) {
          geolocationDataProperty.value = Geolocation(location: location)
      }
  }
  </code></pre>
  
  <p>The view controller: </p>
  
  <pre><code>class MyViewController: UIViewController {
      let viewModel = MyViewModel()
  
      init() {
          super.init(nibName: nil, bundle: nil)
      }
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
          viewModel.geolocationData
              .observe(on: UIScheduler())
              .observeValues { geolocation in
                  debugPrint("GOT GEOLOCATION")
          }
      }
  }
  </code></pre>