How to reverse an Integer ?

[Question]: Reverse Integer in swift ex. 12345 => 54321 output should lie in Int32 Range Explanation: Here we are multiplying result with10 further adding it to modulo(reminder) & get last element by divide by 10