Daily iOS
UIKit

Corner cycling animation

A 25-minute UIKit exercise. A small logo view has to move through the four corners in order, top-left, top-right, bottom-right, bottom-left, forever, like the old DVD screensaver. How would you implement it?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Keep the four target frames in an array and chain calls: in UIView.animate's completion, call the same function again with the next index. .repeat only repeats a single block and can't express a four-leg path.

Share a question