You are required to solve the following problem. Please provide a fully working Xcode project with clearly structured files and all resources required to run successfully.
Please check the code compiles before submitting
This test should take a maximum of 2 hours to complete.
You are required to arrange an arbitrary number of coloured boxes on the screen in rows and columns. The following criteria applies:
- The boxes should be sized at 100x100px.
- The boxes should have spacing between them of 10px.
- The boxes should be a random colour.
- You may use either UIView’s for the boxes or CALayer’s, whichever you prefer.
- The total number of boxes must be able to change in a single point in the code.
- The boxes should be laid out in rows, moving onto a new row when the next box can no longer fit on remaining row.
- Tapping on a box will remove it from its current position and add it to the end.
- No empty spaces should be left once a box is removed and placed at the end.
- All boxes should animate into their current position.
End of test.