Reputation: 2650
I found a lot of tutorials for SwiftUI where the modifier .resizable() is used on an Image. It doesn't seem to be available anymore on Xcode 13.3.1 with Swift 5.
SwiftUI is imported. If you type the whole modifier myself is says
Upvotes: 3
Views: 571
Reputation: 620
You are using a different Image
, it's not from SwiftUI. See the color of Image is lite green(ies). You might be using an Image extension or something. Make sure while typing Image..., you select Image from SwiftUI.
Upvotes: 2
Reputation: 257711
Local module defines have a preference over system. Taking into account context menu proposals it is your case.
The fix is to use module explicitly, like
SwiftUI.Image("myImage").resizable()
Upvotes: 1
Reputation: 89172
It looks like the Image
you are getting is from some other module (not SwiftUI).
If you are 100% sure you don't have another import -- then I recommend exiting Xcode and deleting derived data.
rm -rf ~/Library/Developer/Xcode/DerivedData/
Upvotes: 1
Reputation: 77641
It definitely is...
Have you definitely imported SwiftUI in that file?
If you type the whole thing out does it build or does it cause an error?
From the auto completion drop down it looks like Xcode thinks you’re referring to an imageURL
perhaps there is a change that Xcode hasn’t caught up with yet.
Upvotes: 1