Slide 24
Slide 24 text
func body(content: Content) -> some View {
content
.overlay(alignment: alignment) {
toastMaker(toastHandler)
}
.environment(\.displayToast,
toastHandler.queueMessage(_:))
}
}
extension View {
func displayToast(
on alignment: Alignment,
handledBy toastHandler: ToastHandler,
toastMaker: @escaping (ToastHandler) -> Toast
) -> some View {
self.modifier(
ToastDisplayModifier(
alignment: alignment,
toastHandler: toastHandler,
toastMaker: toastMaker
)
)
}
}
ͦͯ͠7JFX.PEJpFSΛ࡞Δ
.PEJpFSΛద༻͢ΔͨΊͷ
֦ுΛ࣮