---
source_url: https://www.pubnub.com/docs/sdks/swift/api-reference/misc
title: Utility Methods API for Swift Native SDK
updated_at: 2026-06-23T11:46:07.079Z
sdk_name: PubNub Swift SDK
sdk_version: 10.1.7
---

> Documentation Index
> For a curated overview of PubNub documentation, see: https://www.pubnub.com/docs/llms.txt
> For the full list of all documentation pages, see: https://www.pubnub.com/docs/llms-full.txt


# Utility Methods API for Swift Native SDK

PubNub Swift SDK, use the latest version: 10.1.7

Install:

```bash
Add PubNub via Swift Package Manager or CocoaPods@10.1.7
```

The methods on this page are utility methods that don't fit into other categories.

## Disconnect

Call the `disconnect` method to stops the subscriptions in progress.

### Methods

To `disconnect` the data you can use the following methods in Swift SDK.

```swift
func disconnect( )
```

### Sample code

```swift
// Stops the subscriptions in progress
pubnub.disconnect()
```

## Reconnect

Call the `reconnect` method to force the SDK to try and reach out PubNub.

### Method(s)

To `reconnect` the data you can use the following method(s) in Swift SDK.

```swift
func reconnect(at timetoken: Timetoken? = nil)
```

| Parameter | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| at | Timetoken | Yes |  | The timetoken to `reconnect` the subscribe at. |

### Sample code

```swift
// Reconnets to a stopped subscription with the previous subscribed channels and channel groups
pubnub.reconnect()
```