Instance Method インスタンスメソッド

badge(_:)

Generates a badge for the view from a string.

Declaration 宣言

func badge<S>(_ label: S?) -> some View where S : StringProtocol

Parameters パラメータ

label

An optional string to display as a badge. Set the value to nil to hide the badge.

Discussion 議論

Badges are only displayed in list rows and tab bars.

Use a badge to convey optional, supplementary information about a view. Keep the contents of the badge as short as possible.

This modifier creates a Text view on your behalf, and treats the localized key similar to init(_:).

See Also 参照

Badges