<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/UIHostingOrnament",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI17UIHostingOrnamentC"
  },
  "title" : "UIHostingOrnament"
}
-->

# UIHostingOrnament

A model that represents an ornament suitable for being hosted in UIKit.

```
class UIHostingOrnament<Content> where Content : View
```

## Overview

Use a `UIHostingOrnament` when you want to add ornaments to a UIKit
view controller.
For example, the following adds a single bottom ornament to the current
view controller:

```
self.ornaments = [
    UIHostingOrnament(sceneAnchor: .bottom) {
        OrnamentContent()
    }
]
```

## Topics

### Creating a hosting ornament

[`init(sceneAnchor:contentAlignment:content:)`](/documentation/SwiftUI/UIHostingOrnament/init(sceneAnchor:contentAlignment:content:))

Creates an ornament with the specified alignment and content.

[`rootView`](/documentation/SwiftUI/UIHostingOrnament/rootView)

The root view of the SwiftUI view hierarchy managed by this ornament.

### Setting the alignment

[`contentAlignment`](/documentation/SwiftUI/UIHostingOrnament/contentAlignment)

The alignment in the ornament used to position it.

[`sceneAnchor`](/documentation/SwiftUI/UIHostingOrnament/sceneAnchor)

The anchor point for aligning the ornament’s content (based on the
`contentAlignment`) with the scene.



---

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)