Bubble/Threaded/Components/OnlineImage.swift

24 lines
518 B
Swift
Raw Normal View History

2023-12-29 11:17:37 +01:00
//Made by Lumaa
import SwiftUI
struct OnlineImage: View {
var url: URL
var body: some View {
AsyncImage(url: url) { element in
element
.resizable()
.scaledToFit()
.aspectRatio(1.0, contentMode: .fit)
} placeholder: {
Rectangle()
.fill(Color.gray)
.overlay {
ProgressView()
.progressViewStyle(.circular)
}
}
}
}