AlertIOS # | Edit on GitHub |
The AlertsIOS utility provides two functions: alert
and prompt
. All
functionality available through AlertIOS.alert
is also available in the
cross-platform Alert.alert
, which we recommend you use if you don't need
iOS-specific functionality.
AlertIOS.prompt
allows you to prompt the user for input inside of an
alert popup.
Creates a popup to alert the user. See Alert.
callbackOrButtons -- This optional argument should be either a single-argument function or an array of buttons. If passed a function, it will be called when the user taps 'OK'.
If passed an array of button configurations, each button should include
a text
key, as well as optional onPress
and style
keys.
style
should be one of 'default', 'cancel' or 'destructive'.
Example:
Prompt the user to enter some text.
callbackOrButtons -- This optional argument should be either a single-argument function or an array of buttons. If passed a function, it will be called with the prompt's value when the user taps 'OK'.
If passed an array of button configurations, each button should include
a text
key, as well as optional onPress
and style
keys (see example).
style
should be one of 'default', 'cancel' or 'destructive'.
Example with custom buttons:
Example with the default button and a custom callback:
Examples # | Edit on GitHub |