This does not seem like Swift Student Challenge problem, but more likely as understanding recursion.
I would recommend reading recursive implementation on Hanoi Towe in
wikipedia. Even the code is written in python, it can be easily rewritten into Swift.
Or you can check code in Swift
here