Skip to content

.palette Modifier Cannot be Applied to WindowGroup #2

@MatiMax

Description

@MatiMax

Issue

The .palette modifier cannot be applied to WindowGroup as demonstrated in the README.md.

Tested Environment

The test has been conducted on

  • Ubuntu Server 24.04 LTS with Swift toolchain version 6.3.2
  • macOS Sequoia 15.7.7 with Swift toolchain version 6.2.4.1.4

and TUIKit main branch version.

How to Reproduce

@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
       }
        .palette(SystemPalette(.green))  // Classic green terminal 
    }
}

Observed Behaviour

Compiling the code will result in the following error:

App.swift:9:5: error: value of type 'WindowGroup<ContentView>' has no member 'palette'
 7 |             ContentView()
 8 |         }
 9 | 			.palette(SystemPalette(.amber))
   |     `- error: value of type 'WindowGroup<ContentView>' has no member 'palette'
10 |     }
11 | }

Expected Behaviour

Compiling the code should be successful regarding to TUIkit's own documentation.

Work-around

Moving the .palette modifier to the ContentView() results in successful compilation, and the application works visually as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions