One Logo Pool Ball
SwiftUICore · IOS API REFERENCE

ContentShapeKinds

struct · iOS 15.0+ · SDK 27.1

struct ContentShapeKinds

A kind for the content shape of a view. The kind is used by the system to influence various effects, hit-testing, and more.

Members (8)

get · iOS 15.0+

dragPreview

TypeScript
get dragPreview(): ContentShapeKinds
Swift declaration
static let dragPreview: ContentShapeKinds

The kind for drag and drop previews. When using this kind, only the preview shape is affected. To control the shape used to hit-test and start the drag preview, use the `interaction` kind.

get · iOS 15.0+

hoverEffect

TypeScript
get hoverEffect(): ContentShapeKinds
Swift declaration
static let hoverEffect: ContentShapeKinds

The kind for hover effects. When using this kind, only the preview shape is affected. To control the shape used to hit-test and start the effect, use the `interaction` kind. On tvOS, this is used to define the shape of any hover effect applied to focusable and hoverable controls, for example button border or clipping shapes. This kind does not affect the `onHover` modifier.

get · iOS 15.0+

interaction

TypeScript
get interaction(): ContentShapeKinds
Swift declaration
static let interaction: ContentShapeKinds

The kind for hit-testing and accessibility. Setting a content shape with this kind causes the view to hit-test using the specified shape.

get · iOS 17.0+

accessibility

TypeScript
get accessibility(): ContentShapeKinds
Swift declaration
static let accessibility: ContentShapeKinds

The kind for accessibility visuals and sorting. Setting a content shape with this kind causes the accessibility frame and path of the view's underlying accessibility element to match the shape without adjusting the hit-testing shape, updating the visual focus ring that assistive apps, such as VoiceOver, draw, as well as how the element is sorted. Updating the accessibility shape is only required if the shape or size used to hit-test significantly diverges from the visual shape of the view. To control the shape for accessibility and hit-testing, use the `interaction` kind.

get · iOS 15.0+

contextMenuPreview

TypeScript
get contextMenuPreview(): ContentShapeKinds
Swift declaration
static let contextMenuPreview: ContentShapeKinds

The kind for context menu previews. When using this kind, only the preview shape will be affected. To control the shape used to hit-test and start the context menu presentation, use the `.interaction` kind.

init · iOS 15.0+

init

TypeScript
init(rawValue: number): ContentShapeKinds
Swift declaration
init(rawValue: Int)

Creates a content shape kind.

get · iOS 15.0+

rawValue

TypeScript
getRawValue($self: ContentShapeKinds): number
Swift declaration
var rawValue: Int

The corresponding value of the raw type. A new instance initialized with `rawValue` will be equivalent to this instance. For example: enum PaperSize: String { case A4, A5, Letter, Legal } let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter" print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"

set · iOS 15.0+

rawValue

TypeScript
setRawValue($self: ContentShapeKinds, value: number): void
Swift declaration
var rawValue: Int

The corresponding value of the raw type. A new instance initialized with `rawValue` will be equivalent to this instance. For example: enum PaperSize: String { case A4, A5, Letter, Legal } let selectedSize = PaperSize.Letter print(selectedSize.rawValue) // Prints "Letter" print(selectedSize == PaperSize(rawValue: selectedSize.rawValue)!) // Prints "true"

Skipped declarations

No declarations were skipped in this snapshot.

All SwiftUICore types →