. How To Use SF Symbol Variable With SwiftUI 4? – iappstop-Today's Technology

How To Use SF Symbol Variable With SwiftUI 4?

How To Use SF Symbol Variable With SwiftUI 4?

swiftui 4 toggle animation

With SwiftUI 4, you can change the design of the icons where we use the Sf symbol by giving them values ​​between 0 and 1.

Depending on the situation in the application, for example, when you want to symbolize the wifi connection status, you can show the relevant icon to the user by giving the connection status between 0 and 1 to the icon variableValue variable.

struct SfsymbolVariableExample: View {
    var body: some View {
        VStack {
            HStack {
                Image(systemName: "wifi", variableValue: 0.3)
                Image(systemName: "chart.bar.fill", variableValue: 0.5)
            }
        }
        .font(.system(size: 70))
        .foregroundColor(.blue)
        .padding()
    }
}

Please indicate the result in the comments.

Post Comment