<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SharedWithYou",
  "identifier" : "/documentation/SharedWithYou/SWAttributionView",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Shared with You"
    ],
    "preciseIdentifier" : "c:objc(cs)SWAttributionView"
  },
  "title" : "SWAttributionView"
}
-->

# SWAttributionView

A view that displays the sender who shares a highlight and provides related actions.

```
class SWAttributionView
```

## Overview

The `SWAttributionView` also allows users to get back to the conversation about the [`SWHighlight`](/documentation/SharedWithYou/SWHighlight) content, and other related actions using a [`highlightMenu`](/documentation/SharedWithYou/SWAttributionView/highlightMenu).

Place an `SWAttributionView` next to the content represented by its `SWHighlight`. The `SWAttributionView` displays the names and avatars within the provided horizontal space.

You can constrain this view’s width anchor or set its frame width to control the maximum width of its contents after which truncation may occur. Don’t constrain the view’s height, as the height is dependent on the <doc://com.apple.documentation/documentation/UIKit/UIApplication/preferredContentSizeCategory>, and the resulting font size. To provide enough vertical space around this view, reference its <doc://com.apple.documentation/documentation/UIKit/UIView/heightAnchor> when using Auto Layout, or its <doc://com.apple.documentation/documentation/UIKit/UIView/intrinsicContentSize> when using manual layout.

## Topics

### Customizing highlights

[`backgroundStyle`](/documentation/SharedWithYou/SWAttributionView/backgroundStyle-swift.property)

The background style of the child view that contains names and avatars.

[`displayContext`](/documentation/SharedWithYou/SWAttributionView/displayContext-swift.property)

The context for the content the system displays with this view.

[`highlight`](/documentation/SharedWithYou/SWAttributionView/highlight)

The highlight you use to display this attribution.

[`highlightMenu`](/documentation/SharedWithYou/SWAttributionView/highlightMenu)

A menu with a list of system actions specific to this hightlight.

[`horizontalAlignment`](/documentation/SharedWithYou/SWAttributionView/horizontalAlignment-swift.property)

The horizontal alignment of the view.

[`menuTitleForHideAction`](/documentation/SharedWithYou/SWAttributionView/menuTitleForHideAction)

A localized string the system uses as a custom title for the hide menu item.

[`preferredMaxLayoutWidth`](/documentation/SharedWithYou/SWAttributionView/preferredMaxLayoutWidth)

A width the system uses to constrain the view contents.

[`supplementalMenu`](/documentation/SharedWithYou/SWAttributionView/supplementalMenu)

A supplemental menu to augment the attribution view’s existing menu.

[`enablesMarquee`](/documentation/SharedWithYou/SWAttributionView/enablesMarquee)

Automatically enables a marquee effect.

### Customizing the view

[`SWAttributionView.BackgroundStyle`](/documentation/SharedWithYou/SWAttributionView/BackgroundStyle-swift.enum)

The background styling of the attribution view’s contents.

[`SWAttributionView.DisplayContext`](/documentation/SharedWithYou/SWAttributionView/DisplayContext-swift.enum)

The context for the content that influences the ranking of this view’s highlight.

[`SWAttributionView.HorizontalAlignment`](/documentation/SharedWithYou/SWAttributionView/HorizontalAlignment-swift.enum)

The horizontal alignment of attribution view’s contents.



---

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)