Daily iOS
App lifecycle and system

State restoration across devices

You support the same music playback screen on iPhone, iPad, and CarPlay. When the app has been terminated and a scene reconnects, what would you restore the playing state from?

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

Save the current track id, the playback position in seconds, and the queue order with a version to disk instead of the screen objects, and when the scene reconnects, look the track up in the library again by that identifier and line the audio engine and the screen up with it.

Share a question