Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The ReownAppKitUI/Modifiers/Conditional.swift View Extension should be marked private or internal #26

Open
itsallmememe opened this issue Oct 3, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@itsallmememe
Copy link

itsallmememe commented Oct 3, 2024

Describe the bug
The ReownAppKitUI/Modifiers/Conditional.swift View Extension conflicts with my own, this should not happen :)

SDK Version

  • Client: Swift
  • Version 1.0.2

To Reproduce
Create an application that imports the ReOwn SDK
In the main application target create an extension as follows

@ViewBuilder func `if`(_ condition: @autoclosure () -> Bool, transform: (Self) -> some View) -> some View {
    if condition() {
        transform(self)
    } else {
        self
    }
}

Add a view that uses the conditional extension

struct BugView: View {
    var body: some View {
        Color.red
            .if(true) { view in
                        view.padding([.leading, .trailing], -16)
            }
    }
}

Xcode should throw a build error because if conflicts with the View+Extension in the Sources/ReownAppKitUI/Modifiers folder

Expected behavior
Any extensions in your SDK should be made private / internal to ensure that they do not conflict with clients application

Screenshots
image

Device (please complete the following information):

  • Device: Mac
  • OS: MacOS

Additional context
Add any other context about the problem here.

@itsallmememe itsallmememe added the bug Something isn't working label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant