---
title: "subscribe(_:)"
framework: combine
role: symbol
role_heading: Instance Method
path: "combine/publisher/subscribe(_:)-4u8kn"
---

# subscribe(_:)

Attaches the specified subscriber to this publisher.

## Declaration

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

## Parameters

- `subscriber`: The subscriber to attach to this publisher. After attaching, the subscriber can start to receive values.

## Discussion

Discussion Always call this function instead of receive(subscriber:). Adopters of Publisher must implement receive(subscriber:). The implementation of subscribe(_:) provided by Publisher calls through to receive(subscriber:).

## See Also

### Working with subscribers

- [receive(subscriber:)](combine/publisher/receive(subscriber:).md)
- [subscribe(_:)](combine/publisher/subscribe(_:)-3fk20.md)
