# Hiding Channels

Hiding a channel removes it from query channel requests for that user until a new message is added. Only channel members can hide a channel.

Hidden channels may still have unread messages. Consider [marking the channel as read](https://getstream.io/chat/docs/ios-swift/unread/) before hiding it.

You can optionally clear the message history for that user when hiding. When a new message is received, it will be the only message visible to that user.

## Hide a Channel

```swift label="Swift"
import StreamChat

let controller = chatClient.channelController(for: .init(type: .messaging, id: "general"))

// Controllers

// hide channel
controller.hideChannel { error in
  if let error = error {
    // handle error
    print(error)
  }
}

// show channel
controller.showChannel { error in
  if let error = error {
    // handle error
    print(error)
  }
}

// hide channel and clear message history
controller.hideChannel(clearHistory: true) { error in
  if let error = error {
    // handle error
    print(error)
  }
}

// State layer (async-await)

// hide channel
try await chat.hide()

// show channel
try await chat.show()

// hide channel and clear message history
try await chat.hide(clearHistory: true)
```

>
> **Info:** You can still retrieve the list of hidden channels using the `{ "hidden" : true }` query parameter.
>

---

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/ios-swift/hiding-channels/](https://getstream.io/chat/docs/ios-swift/hiding-channels/).