<!--
{
  "availability" : [
    "macOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Settings/init(content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI8SettingsV7contentACyxGxyXE_tcfc"
  },
  "title" : "init(content:)"
}
-->

# init(content:)

Creates a scene that presents an interface for viewing and modifying
an app’s preferences.

```
nonisolated init(@ContentBuilder content: () -> Content)
```

## Parameters

`content`

A view that represents the content of the scene.

## Discussion

Use `Settings(content:)` to add a preferences scene when you declare
your app using the [`App`](/documentation/SwiftUI/App) protocol.

The example below shows the view content for the settings scene
added to the SwiftUI app delegate:

```
@main
struct MacSwiftUISnippets: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }
        #if os(macOS)
        Settings {
            SettingsView()
        }
        #endif
    }
}
```

When you use an [`App`](/documentation/SwiftUI/App) declaration for multiple platforms,
compile the settings scene only in macOS, as shown in the example above.

---

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)