Sobes.tech
Back to tasks
Junior — Senior
44

Переиспользуемый компонент кнопки

Get help with live coding in real time with Sobes Copilot
Task condition

Необходимо реализовать универсальную кнопку, позволяющую задать отображаемый текст и действие при её нажатии.

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

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