Swift Playgrounds app is a great way to get started coding Swift on the go. To use it:

1- Download Swift Playgrounds for iPad from App Store.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/65e98b4e-6571-4fb4-88a5-70b2835138a3/Untitled.png

2- Open the app.

3- In the My Playgrounds tab, tap + on the top left corner and then select Blank template.

4- Enter your code.

5- Tap Run My Code to run your code.

6- At the front of each line, the result will be stored in a small square. Tap it to reveal the result.

7- To step slowly through code to trace it, tap the button next to Run My Code.