---
title: "setHidden(_:)"
framework: watchkit
role: symbol
role_heading: Instance Method
path: "watchkit/wkinterfaceobject/sethidden(_:)"
---

# setHidden(_:)

Hides or shows the interface object in your user interface.

## Declaration

```swift
func setHidden(_ hidden: Bool)
```

## Parameters

- `hidden`: A Boolean value indicating the visibility of the object. Specify doc://com.apple.documentation/documentation/Swift/true to hide the object. Specify doc://com.apple.documentation/documentation/Swift/false to show it.

## Mentioned in

Connecting Your User Interface to Your Code

## Discussion

Discussion When you hide or show an object in your interface, WatchKit makes a note to update the layout during the next refresh cycle. During that cycle, WatchKit adjusts the layout to display only the currently visible objects.

## See Also

### Related Documentation

- [App Programming Guide for watchOS](apple-archive/documentation/General/Conceptual/WatchKitProgrammingGuide.md)

### Hiding and Showing an Object

- [setAlpha(_:)](watchkit/wkinterfaceobject/setalpha(_:).md)
