Skip to content

Inconsistent Shared override in #Preview between iOS and macOS #188

Description

@teleki

Description

I want to override shared data for the preview. The following code works fine on iOS, but has no effect on macOS. I am on the latest released versions.

The attached screen shots have both the code and the output in the preview.

The iOS version correctly shows ["Mock"] while the macOS version just shows an empty array: [].

Image Image

Checklist

  • I have determined whether this bug is also reproducible in a vanilla SwiftUI project.
  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue or discussion.

Expected behavior

I expect that I can override the shared data.

Actual behavior

I can override the shared data for #Preview in iOS, but not in macOS.

Reproducing project

iOS: SharingTest.zip

macOS: SharingTestMac.zip

Sharing version information

2.7.2

Destination operating system

iOS 18.6

Xcode version information

16.4

Swift Compiler version information

swift-driver version: 1.120.5 Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)
Target: arm64-apple-macosx15.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    apple bugSomething isn't working due to a bug on Apple's platforms.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions