mirror of
https://github.com/ivanvorobei/SwiftUI.git
synced 2026-04-26 02:28:36 +02:00
Add Async image loading
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
See LICENSE folder for this sample’s licensing information.
|
||||
|
||||
Abstract:
|
||||
A view that clips an image to a circle and adds a stroke and shadow.
|
||||
*/
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct CircleImage: View {
|
||||
var image: Image
|
||||
|
||||
var body: some View {
|
||||
image
|
||||
.clipShape(Circle())
|
||||
.overlay(Circle().stroke(Color.white, lineWidth: 4))
|
||||
.shadow(radius: 10)
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
struct CircleImage_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
CircleImage(image: Image("turtlerock"))
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user