Skip to content

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

@itsallmememe

Description

@itsallmememe

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions