Daily iOS
UIKit

List UI with a completed state

A UIKit table screen shows election results. Once every district's result has arrived, the refresh button should hide and the winner's row should be highlighted. Instead of a temporary flag inside the network callback, how would you represent this "counting complete" condition?

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 completion as one screen state enum with counting and complete cases, not a value known briefly inside a callback. Both the refresh button's visibility and the winner highlight derive from this state, and the transition to complete is computed in the model by checking whether the number of results received equals the total number of districts.

Share a question