Swift UI animated closure

Viewed 35

If I have a SwiftUI view declaration like:

ProfileView(userData, onDoneEdit: {
withAnimation {
        isEditingViewPresented.toggle()
    }
...
}, onCancel: { ... })

does anyone know if it can be implemented a custom annotation that let me have:

ProfileView(userData, onDoneEdit: { @withAnimation
    isEditingViewPresented.toggle()
    ...
    }, onCancel: { ... })

This question is more for learning purpose as I'm experimenting with SwiftUI.

0 Answers
Related