ScaledMetric PropertyWrapper with Image view

ScaledMetric propertyWrapper can be used to resize Image view’s width and height as dynamic text changes its size.

Let’s create an example with ScaledMetric propertyWrapper:
struct ImageExample: View {
    
    @ScaledMetric var size: CGFloat = 100
    
    var body: some View {
        HStack {
            Image("dt")
                .resizable()
                .clipShape(Circle())
                
                .frame(width: size, height: size)
                .background(Circle().stroke(Color.orange, lineWidth: 5))
            
            VStack(alignment: .leading) {
                Text("DevTechie")
                    .font(.largeTitle)
                    
                Text("Learn by doing!")
                    .font(.title3)
            }
        }
    }
}




Notice the change in image size along with text size as I increase and decrease the accessibility text.