splendo / kaluga-swiftui

5 stars 0 forks source link

Add opacity scaleEffect and animation into ButtonStateStyle #38

Open dasdranagon opened 3 months ago

dasdranagon commented 3 months ago

Swift UI allows to add opacity and animation effects into the button style:

struct DemoButtonStyle: SwiftUI.ButtonStyle {
    func makeBody(configuration: SwiftUI.ButtonStyle.Configuration) -> some View {
        configuration.label
            .opacity(configuration.isPressed ? 0.5 : 1)
            .scaleEffect(configuration.isPressed ? 0.5 : 1)
            .animation(.easeOut(duration: 0.2), value: configuration.isPressed)
    }
}

However this possibility seems to be missing in Kaluga SwiftUI