Build: Error Handling Demo
This screen lets the user enter a number and tries to convert it to an integer. If the input is invalid, it shows an error message using Swift's try, catch, and throw error handling.
Target UI
------------------------- | Error Handling Demo | ------------------------- | Enter a number: | | [______________] | | [Convert] | | | | Result: | | | -------------------------
A TextField for user input of a number
A Convert button below the TextField
When Convert is tapped, try to convert input to Int using a throwing function
If conversion succeeds, show 'Valid number: X' in Result label
If conversion fails, catch the error and show 'Error: Invalid number' in Result label
Use Swift's try, catch, and throw keywords properly