Compose SwiftUIv0.4.0
esc
GuideAPIGitHub
View modifier

disabled(_:)

Disables the controls in a view.

iOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+
fun Modifier.disabled(disabled: Boolean): Modifier

Overview

Button("Send", action = vm::send, modifier = Modifier.disabled(!canSend))

This is the Kotlin form of SwiftUI View.disabled(_:): SwiftUI documentation. In Swift it reads:

nonisolated func disabled(_ disabled: Bool) -> some View

Topics

Overloads

fun Modifier.disabled(disabled: Boolean): Modifier
SwiftUI View.disabled(_:)