'Checking the entered data for correctness swift [closed]

How can I make a check for the correctness of the entered data?

For example, the user needs to enter a digit, and until this is done, the program will not skip it further

In my case, you need to make sure that the user entered an integer, and not a string, double, etc.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source