Slide 50
Slide 50 text
iOS の実装
50
iosMain/Dialog.ios.kt
@Composable
actual fun Dialog(state: DialogState) {
val alert = UIAlertController.alertControllerWithTitle(
title = state.title,
message = state.text,
preferredStyle = UIAlertControllerStyleAlert,
)
state.confirmButton.let { button ->
alert.addAction(
UIAlertAction.actionWithTitle(
title = button.text,
style = UIAlertActionStyleDefault,
handler = { button.action() },
),
)
}
state.dismissButton-.let { button ->
alert.addAction(
UIAlertAction.actionWithTitle(
title = button.text,
style = UIAlertActionStyleCancel,
handler = { button.action() },
),
)
}
LocalUIViewController.current.showViewController(
vc = alert,
sender = null,
)
}
Dialog.kt
Dialog.ios.kt
UIKit
UIAlertController
commonMain
iosMain