Slide 104
Slide 104 text
Optional item ͷΈΛཁٻ͢Δ API Λߟ͑Δ
extension View {
func alert(
title: (T) -> Text,
presenting data: Binding,
@ViewBuilder actions: @escaping (T) -> A,
@ViewBuilder message: @escaping (T) -> M
) -> some View {
self.alert(
???, // alert title
isPresented: ???,
presenting: data.wrappedValue,
actions: actions,
message: message
)
}
}
Navigation API ͷ՝ʹͲ͏ཱ͔ͪ͏͔ > ঢ়ଶཧΛෳࡶʹͤ͞Δ API ͕ଘࡏ͍ͯ͠Δ > ঢ়ଶཧΛෳࡶʹͤ͞ͳ͍ API overloads