---
title: WKInterfaceObject
framework: watchkit
role: symbol
role_heading: Class
path: watchkit/wkinterfaceobject
---

# WKInterfaceObject

An object that provides information that is common to all interface objects in your watchOS app.

## Declaration

```swift
class WKInterfaceObject
```

## Mentioned in

Connecting Your User Interface to Your Code

## Overview

Overview Your WatchKit extension uses interface objects to manipulate the visual elements displayed on Apple Watch. Specifically, you use the methods of this class to change the size, alignment, and visibility of those elements. You can also configure the accessibility information displayed through assistive technologies like VoiceOver. Do not subclass or create instances of this class, or any of its subclasses, yourself. Instead, define outlets in your interface controller class and connect them to the corresponding objects in your storyboard file. For example, to refer to a button in your interface, define a property with the following syntax in your interface controller class: At runtime, WatchKit creates the appropriate interface objects and assigns them to the outlets in your interface controller. WatchKit provides one-way communication between the interface objects in your extension and the corresponding interface elements in your watchOS app. You can set the values of an interface object, but you cannot get the current values. If you want to know the current value of an attribute, you must save the value yourself. Interface Builder Configuration Options Xcode lets you configure information about your group interface object in your storyboard file. The following table lists the attributes you can configure in your storyboard and their meaning.  |   |   |   |   |   |   |   |

## Topics

### Hiding and Showing an Object

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

### Getting the Property Name

- [interfaceProperty](watchkit/wkinterfaceobject/interfaceproperty.md)

### Changing an Object’s Size

- [setWidth(_:)](watchkit/wkinterfaceobject/setwidth(_:).md)
- [setHeight(_:)](watchkit/wkinterfaceobject/setheight(_:).md)
- [setRelativeWidth(_:withAdjustment:)](watchkit/wkinterfaceobject/setrelativewidth(_:withadjustment:).md)
- [setRelativeHeight(_:withAdjustment:)](watchkit/wkinterfaceobject/setrelativeheight(_:withadjustment:).md)
- [sizeToFitWidth()](watchkit/wkinterfaceobject/sizetofitwidth().md)
- [sizeToFitHeight()](watchkit/wkinterfaceobject/sizetofitheight().md)

### Setting an Object’s Alignment

- [setHorizontalAlignment(_:)](watchkit/wkinterfaceobject/sethorizontalalignment(_:).md)
- [setVerticalAlignment(_:)](watchkit/wkinterfaceobject/setverticalalignment(_:).md)

### Configuring the Accessibility Attributes

- [setAccessibilityIdentifier(_:)](watchkit/wkinterfaceobject/setaccessibilityidentifier(_:).md)
- [setAccessibilityLabel(_:)](watchkit/wkinterfaceobject/setaccessibilitylabel(_:).md)
- [setAccessibilityHint(_:)](watchkit/wkinterfaceobject/setaccessibilityhint(_:).md)
- [setAccessibilityValue(_:)](watchkit/wkinterfaceobject/setaccessibilityvalue(_:).md)
- [setIsAccessibilityElement(_:)](watchkit/wkinterfaceobject/setisaccessibilityelement(_:).md)
- [setAccessibilityTraits(_:)](watchkit/wkinterfaceobject/setaccessibilitytraits(_:).md)
- [setAccessibilityImageRegions(_:)](watchkit/wkinterfaceobject/setaccessibilityimageregions(_:).md)

### Setting the Layout Direction

- [setSemanticContentAttribute(_:)](watchkit/wkinterfaceobject/setsemanticcontentattribute(_:).md)

### Constants

- [WKInterfaceObjectHorizontalAlignment](watchkit/wkinterfaceobjecthorizontalalignment.md)
- [WKInterfaceObjectVerticalAlignment](watchkit/wkinterfaceobjectverticalalignment.md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Inherited By

- [WKInterfaceActivityRing](watchkit/wkinterfaceactivityring.md)
- [WKInterfaceAuthorizationAppleIDButton](watchkit/wkinterfaceauthorizationappleidbutton.md)
- [WKInterfaceButton](watchkit/wkinterfacebutton.md)
- [WKInterfaceDate](watchkit/wkinterfacedate.md)
- [WKInterfaceGroup](watchkit/wkinterfacegroup.md)
- [WKInterfaceHMCamera](watchkit/wkinterfacehmcamera.md)
- [WKInterfaceImage](watchkit/wkinterfaceimage.md)
- [WKInterfaceInlineMovie](watchkit/wkinterfaceinlinemovie.md)
- [WKInterfaceLabel](watchkit/wkinterfacelabel.md)
- [WKInterfaceMap](watchkit/wkinterfacemap.md)
- [WKInterfaceMovie](watchkit/wkinterfacemovie.md)
- [WKInterfacePaymentButton](watchkit/wkinterfacepaymentbutton.md)
- [WKInterfacePicker](watchkit/wkinterfacepicker.md)
- [WKInterfaceSCNScene](watchkit/wkinterfacescnscene.md)
- [WKInterfaceSKScene](watchkit/wkinterfaceskscene.md)
- [WKInterfaceSeparator](watchkit/wkinterfaceseparator.md)
- [WKInterfaceSlider](watchkit/wkinterfaceslider.md)
- [WKInterfaceSwitch](watchkit/wkinterfaceswitch.md)
- [WKInterfaceTable](watchkit/wkinterfacetable.md)
- [WKInterfaceTextField](watchkit/wkinterfacetextfield.md)
- [WKInterfaceTimer](watchkit/wkinterfacetimer.md)
- [WKInterfaceVolumeControl](watchkit/wkinterfacevolumecontrol.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### User interface basics

- [Building watchOS app Interfaces Using the Storyboard](watchkit/building-watchos-app-interfaces-using-the-storyboard.md)
- [WKInterfaceController](watchkit/wkinterfacecontroller.md)
- [WKAlertAction](watchkit/wkalertaction.md)
- [WKAccessibilityImageRegion](watchkit/wkaccessibilityimageregion.md)
- [WKAccessibilityIsVoiceOverRunning()](watchkit/wkaccessibilityisvoiceoverrunning().md)
- [WKAccessibilityIsReduceMotionEnabled()](watchkit/wkaccessibilityisreducemotionenabled().md)
