You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[v] I have read the wiki page and cheat sheet, but there is no information I need.
[v] I have searched in existing issues, but did not find a same one.
[v] I want to report a problem instead of asking a question. It'd better to use kingfisher tag in Stack Overflow to ask a question.
Issue Description
Kingfisher's ImageResource type name conflicts with new type name generated by Xcode 15.
This code raises an error:
let resource = ImageResource(downloadURL: URL(string: "https://www.google.com.tw")!)
KingfisherManager.shared.retrieveImage(with: resource, options: []) { [weak self] result in }
What
Xcode 15 introduces a new feature that allows developers to use Image assets without hard-coding the file name, example:
Old way:
UIImage(named: "demoAsset")
New way:
UIImage(resource: .demoAsset)
This is done by Xcode, generating the symbol for developers.
And because the type of property resource is also called ImageResource, this conflicts with Kingfisher's ImageResource symbol, causing a compile error.
Note that if you setup a new project to reproduce this issue, remember to set deployment target to < iOS 17.0
It seems like with deployment target iOS 17.0, Xcode adds an extra namespace called DeveloperToolsSupport before ImageResource, causing we can't reproduce this issue.
The text was updated successfully, but these errors were encountered:
JohnnyTseng
changed the title
ImageResource type seems to be conflicting with Xcode 15's new typeImageResource type seems to be conflicting with Xcode 15's new type, causing a compile error.
Jun 12, 2023
Simply changing the name ImageResource would be a simple solution, but it introduces a breaking change, I'm not sure how we could deal with this in a better way 🤔
Check List
Issue Description
Kingfisher's
ImageResource
type name conflicts with new type name generated by Xcode 15.This code raises an error:
What
Xcode 15 introduces a new feature that allows developers to use Image assets without hard-coding the file name, example:
Old way:
New way:
This is done by Xcode, generating the symbol for developers.
And because the type of property
resource
is also calledImageResource
, this conflicts with Kingfisher'sImageResource
symbol, causing a compile error.Reproduce
Clone and build this project: https://github.com/JohnnyTseng/KingfisherXcode15Demo
Other Comment
Environment:
Note that if you setup a new project to reproduce this issue, remember to set deployment target to
< iOS 17.0
It seems like with deployment target iOS 17.0, Xcode adds an extra namespace called
DeveloperToolsSupport
beforeImageResource
, causing we can't reproduce this issue.The text was updated successfully, but these errors were encountered: