urbanairship / ios-library

Urban Airship iOS SDK
http://urbanairship.com
Apache License 2.0
478 stars 265 forks source link

17.0.0 β€” Ambiguous use of 'overlay(alignment:content:)' #367

Closed michaeldclifford closed 1 year ago

michaeldclifford commented 1 year ago

Preliminary Info

What Airship dependencies are you using?

17.0.0

What are the versions of any relevant development tools you are using?

Xcode 14.3.1, iOS Simulator 16.4

Report

What unexpected behavior are you seeing?

Build error: "Ambiguous use of 'overlay(alignment:content:)'"

What is the expected behavior?

Successful build

What are the steps to reproduce the unexpected behavior?

Update from Airship 16.12.1 to 17.0.0

Do you have logging for the issue?

From the build logs:

.../Pods/Airship/Airship/AirshipCore/Source/StoryIndicator.swift:64:18:
    error: ambiguous use of 'overlay(alignment:content:)'
        .fill(indicatorColor(index))
        ^
.../Pods/Airship/Airship/AirshipCore/Source/ViewExtensions.swift:79:10:
    note: found this candidate
        func overlay<T: View>(
        ^
SwiftUI.View:3:28:
    note: found this candidate
        @inlinable public func overlay<V>(alignment: Alignment = .center, @ViewBuilder content: () -> V) -> some View where V : View
        ^

.../Pods/Airship/Airship/AirshipCore/Source/StoryIndicator.swift:64:18:
    Ambiguous use of 'overlay(alignment:content:)'
khmMouna commented 1 year ago

Thank you for reporting that, we expose an overlay(alignment:content:) that override the SwiftUI one. You can use the deprecated one as a workaround overlay(_ overlay:, alignment: ) and we will work to fix it.

michaeldclifford commented 1 year ago

Thank you

FWIW, the use of .overlay() that it's objecting to is also part of the Airship library, so I don't think we can necessarily use the workaround without unlocking the files and editing the Airship code (which we'd rather avoid).

But it's not a showstopper, as we'll just hold off on updating for now πŸ™‚

khmMouna commented 1 year ago

Sorry for the misunderstood, I am not referring to the . overlay that is part of the Airship library. We don't recommend doing that. But, I think this error will appear if you are using .overlay in your app. It will conflit with the one in the Airship SDK.

michaeldclifford commented 1 year ago

We aren't currently using SwiftUI in our app, so I imagine this will affect all Airship clients, whether they use .overlay() themselves or not.

rlepinski commented 1 year ago

We will get a patch out, thanks for the report. Its always sad to see a patch so quickly after a major release. Looking to see why this did not come up in our builds to make sure there is nothing else.

Thanks again!

michaeldclifford commented 1 year ago

Not a problem. Thank you both πŸ™‚

michaeldclifford commented 1 year ago

Fixed in 17.0.1 πŸ‘