Sobes.tech
Junior — Senior

Reusable button component

livecode

Task condition

It is necessary to implement a universal button that allows setting the displayed text and the action when it is pressed.

struct ReusableButton: View {
    var label: String
    var handler: () -> Void

    var body: some View {
        Button(action: handler) {
            Text(label)
        }
    }
}