yes it does refresh the view/image, it just that your question mentioned that
you want the url to be the same, and so the image is the same.
If you want a different url when you press a button, then just do this:
struct ContentView: View {
@State var url = URL(string: "https://upload.wikimedia.org/wikipedia/commons/9/98/B165841.jpg")
var body: some View {
VStack {
Button("click to refresh view") {
url = URL(string: "https://upload.wikimedia.org/wikipedia/commons/8/81/PIA24681-1041-Ganymede-JupiterMoon-Juno-20210607.jpg")
}
AsyncImage(url: url, scale: 1) { image in
image
.resizable()
.aspectRatio(1, contentMode: .fit)
.frame(width: 300, height: 400, alignment: .center)
} placeholder: {
ProgressView()
.progressViewStyle(CircularProgressViewStyle(tint: .orange))
.scaleEffect(3)
}
}
}
}