[Video](https://www.youtube.com/watch?v=wn_j_fO3Jj8)

[Combine](https://developer.apple.com/documentation/combine) is a
framework for handling asynchronous events by combining event-processing
operators. Combine makes your code easier to read and maintain by centralizing
your event-processing code.

The [GoogleMapsPlatformCombine library](https://github.com/googlemaps/ios-combine)
is a Swift library that returns
[`Publishers`](https://developer.apple.com/documentation/combine/publisher)
for the Maps SDK for iOS and Places SDK for iOS so that you
can take advantage of the rich set of Combine features.

## Installation

For system requirements and installation instructions, see the
[GoogleMapsPlatformCombine library](https://github.com/googlemaps/ios-combine)
documentation on GitHub.

## Example usage

The GoogleMapsPlatformCombine library provides extensions to the
[`GMSPlacesClient`](https://github.com/googlemaps/ios-combine/blob/main/Sources/Places/GMSPlacesClient%2BCombine.swift)
class that return
[`Future`](https://developer.apple.com/documentation/combine/future)
publishers for Places API calls.

Use the `fetchPlace(id:, fields:, sessionToken:) -> Future<GMSPlace, Error>`
extension to fetch place details:

<br />

```yaml
GMSPlacesClient.shared()
  .fetchPlace(
    id: "placeId",
    fields: [.placeID, .name, .phoneNumber]
  )
  .sink { completion in
    print("Completion \(completion)")
  } receiveValue: { place in
    print("Got place \(place.name ?? "")")
  }
```

<br />

## What's next

- See the [Combine library](https://github.com/googlemaps/ios-combine) GitHub project page.