---
title: "receive(subscriber:)"
framework: combine
role: symbol
role_heading: Instance Method
path: "combine/publisher/receive(subscriber:)"
---

# receive(subscriber:)

Attaches the specified subscriber to this publisher.

## Declaration

```swift
func receive<S>(subscriber: S) where S : Subscriber, Self.Failure == S.Failure, Self.Output == S.Input
```

## Parameters

- `subscriber`: The subscriber to attach to this doc://com.apple.Combine/documentation/Combine/Publisher, after which it can receive values.

## Discussion

Discussion Implementations of Publisher must implement this method. The provided implementation of subscribe(_:)calls this method.

## See Also

### Working with subscribers

- [subscribe(_:)](combine/publisher/subscribe(_:)-4u8kn.md)
- [subscribe(_:)](combine/publisher/subscribe(_:)-3fk20.md)
