<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIBehavioralStyle",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@UIBehavioralStyle"
  },
  "title" : "UIBehavioralStyle"
}
-->

# UIBehavioralStyle

Constants that indicate how a control behaves in apps built with Mac Catalyst.

```
enum UIBehavioralStyle
```

## Overview

If you build your app with Mac Catalyst and use the Mac idiom, you can specify the preferred behavior style for a control to change its appearance and behavior. For instance, consider an iPad app that displays a slider with a custom thumb image. By default, the Mac version of the app, built with Mac Catalyst, displays a standard macOS slider when the user interface idiom of the app is [`UIUserInterfaceIdiom.mac`](/documentation/UIKit/UIUserInterfaceIdiom/mac).

To provide a consistent appearance of the slider in the iPad and Mac versions of the app, set the [`preferredBehavioralStyle`](/documentation/UIKit/UISlider/preferredBehavioralStyle) of the slider to [`UIBehavioralStyle.pad`](/documentation/UIKit/UIBehavioralStyle/pad). This behavioral style tells the slider to behave as if the user interface idiom is [`UIUserInterfaceIdiom.pad`](/documentation/UIKit/UIUserInterfaceIdiom/pad) even though the app uses the Mac idiom.

macOS doesn’t scale the interface of apps that use the Mac idiom, so you may need to update your app to accommodate size differences. For example, a slider with a custom thumb image may need a different image for the Mac app than the one used in the iPad app.

```swift
let slider = UISlider()
slider.minimumValue = 0
slider.maximumValue = 1
slider.value = 0.5
slider.preferredBehavioralStyle = .pad

if slider.traitCollection.userInterfaceIdiom == .mac {
    slider.setThumbImage(#imageLiteral(resourceName: "customSliderThumbMac")), for: .normal)
} else {
    slider.setThumbImage(#imageLiteral(resourceName: "customSliderThumb")), for: .normal)
}
```

To learn more about the Mac idiom, see [Choosing a user interface idiom for your Mac app](/documentation/UIKit/choosing-a-user-interface-idiom-for-your-mac-app).

## Topics

### Styles

[`case automatic`](/documentation/UIKit/UIBehavioralStyle/automatic)

A style the system chooses based on the app’s targeted platform.

[`case pad`](/documentation/UIKit/UIBehavioralStyle/pad)

A style that indicates that a control appears and behaves as it does in iPadOS.

[`case mac`](/documentation/UIKit/UIBehavioralStyle/mac)

A style that indicates that a control appears and behaves as it does in macOS.

### Initializers

[`init?(rawValue: UInt)`](/documentation/UIKit/UIBehavioralStyle/init(rawValue:))

## Relationships

### Conforms To

[`Sendable`](/documentation/Swift/Sendable)

[`Equatable`](/documentation/Swift/Equatable)

[`Hashable`](/documentation/Swift/Hashable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`RawRepresentable`](/documentation/Swift/RawRepresentable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)