Skip to main content

custom_modifier

Function custom_modifier 

Source
pub fn custom_modifier(
    view: &ViewHandle,
    modifier: &CustomModifier,
) -> ViewHandle
Expand description

.modifier(_:) with a modifier written in Rust.

The result is ModifiedContent<Self, RustModifier> — a concrete type, not an opaque one, because modifier<T>(_:) says so. T is unconstrained there, so no witness table is passed at the call: SwiftUI finds the conformance by lookup when it renders, which is exactly why registering it matters.