---
title: connect()
framework: combine
role: symbol
role_heading: Instance Method
path: combine/connectablepublisher/connect()
---

# connect()

Connects to the publisher, allowing it to produce elements, and returns an instance with which to cancel publishing.

## Declaration

```swift
func connect() -> any Cancellable
```

## Mentioned in

Controlling Publishing with Connectable Publishers Replacing Foundation Timers with Timer Publishers

## Return Value

Return Value A Cancellable instance that you use to cancel publishing.
