diff --git a/README.md b/README.md index dc53f7e..c63e25a 100644 --- a/README.md +++ b/README.md @@ -532,6 +532,17 @@ For example, let's say you want to use the `weather` module that appeared in ver -- aio_version = "4.1.3" ``` +You can also check the presence of a particular API function this way (note the use of a dot instead of a colon): + +``` +if ui.show_list_dialog then + ui:show_text("list dialog supported") +else + ui:show_text("list dialog is not supported") +end + +``` + # Debugging Some tips on writing and debugging scripts: diff --git a/samples/check-new-api-sample.lua b/samples/check-new-api-sample.lua new file mode 100644 index 0000000..30092dd --- /dev/null +++ b/samples/check-new-api-sample.lua @@ -0,0 +1,7 @@ +function on_resume() + if ui.show_list_dialog then + ui:show_text("list dialog supported") + else + ui:show_text("list dialog is not supported") + end +end