MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / confirm

Function confirm

packages/core/ui/dialogs/index.ios.ts:109–131  ·  view source on GitHub ↗
(arg: any)

Source from the content-addressed store, hash-verified

107}
108
109export function confirm(arg: any): Promise<boolean> {
110 return new Promise<boolean>((resolve, reject) => {
111 try {
112 const options = !isDialogOptions(arg)
113 ? {
114 title: DialogStrings.CONFIRM,
115 okButtonText: DialogStrings.OK,
116 cancelButtonText: DialogStrings.CANCEL,
117 message: arg + '',
118 }
119 : arg;
120 const alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle(options.title, options.message, UIAlertControllerStyle.Alert);
121
122 addButtonsToAlertController(alertController, options, (r) => {
123 resolve(r);
124 });
125
126 showUIAlertController(alertController);
127 } catch (ex) {
128 reject(ex);
129 }
130 });
131}
132
133export function prompt(...args): Promise<PromptResult> {
134 let options: PromptOptions;

Callers

nothing calls this directly

Calls 4

isDialogOptionsFunction · 0.90
showUIAlertControllerFunction · 0.85
resolveFunction · 0.50

Tested by

no test coverage detected