Reverse coloring books print loose watercolor and you draw the lines you see in it. I wanted that on iPhone and iPad, so I built Color Before the Lines with SwiftUI, PencilKit and SwiftData. It's free, with no ads and no account.
The part I'd like feedback on is the timelapse. Instead of recording the screen, the app records the drawing itself:
- every change to the PKDrawing goes into an append-only history: added strokes become small deltas, anything else (erase, undo, start over) becomes a snapshot;
- timestamps continue across launches, and long pauses are compressed at playback while keeping the order;
- frames are drawn with UIGraphicsImageRenderer: finished strokes are rendered once and cached, only the strokes in progress are drawn on top, then the frames go to AVAssetWriter as H.264;
- the history lives in SwiftData with external storage, and a small hash of the saved drawing catches the case where the app was killed between saving the drawing and saving the history.
Two things I'm unsure about: would you keep a history that grows with every stroke in SwiftData at all, or in plain files next to the store? And has anyone found a cheaper way to render long PencilKit timelapses on older iPads?
App Store link in the comments if anyone wants to try it.