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

'View' is ambiguous for type lookup in this context #1305

Closed
3 tasks done
ainopara opened this issue Oct 5, 2019 · 6 comments
Closed
3 tasks done

'View' is ambiguous for type lookup in this context #1305

ainopara opened this issue Oct 5, 2019 · 6 comments

Comments

@ainopara
Copy link

ainopara commented Oct 5, 2019

Check List

Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.

Issue Description

What

#1304 introduce some public type alias which conflict with some components in SwiftUI (View, Color and Button). As a result, any file in host app who imports both Kingfisher and SwiftUI, needs to add module name before those basic SwiftUI components, which leads to inconvenience.

Reproduce

  1. Create a project and intergrate Kingfisher and its subspec Kingfisher/SwiftUI with CocoaPods.
  2. Create a SwiftUI file which import both SwiftUI and Kingfisher.

Other Comment

Is there workaroud to this issue? Thanks.

@onevcat
Copy link
Owner

onevcat commented Oct 5, 2019

It is the cost to maintain the semantic version. To resolve it, you can only import the type you need from Kingfisher instead of importing all. Like:

import class Kingfisher.KingfisherManager

@ainopara
Copy link
Author

ainopara commented Oct 5, 2019

ok, thank you for your quick reply. By the way, is there a plan to release Kingfisher 6.0?

@onevcat
Copy link
Owner

onevcat commented Oct 5, 2019

Not that soon.

@onevcat onevcat closed this as completed Oct 5, 2019
@ismyhc
Copy link

ismyhc commented Oct 8, 2019

It is the cost to maintain the semantic version. To resolve it, you can only import the type you need from Kingfisher instead of importing all. Like:

import class Kingfisher.KingfisherManager

Hi, I don't quite understand what to do here. Was not having any issues until the latest release. For instance, Im just using KFImage and Get the same 'View' is ambiguous for type lookup in this context.

Basically I:

import SwiftUI
import Kingfisher

How would I import Kingfisher now?

@ismyhc
Copy link

ismyhc commented Oct 8, 2019

It is the cost to maintain the semantic version. To resolve it, you can only import the type you need from Kingfisher instead of importing all. Like:

import class Kingfisher.KingfisherManager

Hi, I don't quite understand what to do here. Was not having any issues until the latest release. For instance, Im just using KFImage and Get the same 'View' is ambiguous for type lookup in this context.

Basically I:

import SwiftUI
import Kingfisher

How would I import Kingfisher now?

Just figured something out. When using CocoaPods, I could figure out how to import. But when using SPM I can just import with KingfisherSwiftUI and everything works fine.

@onevcat
Copy link
Owner

onevcat commented Oct 10, 2019

Yes. If you only use types from KingfisherSwiftUI and not import Kingfisher at all, you will not get any ambiguous for type definitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants