A character browser backed by the Rick and Morty API.
- On launch, characters load into a table view
- Each row shows: avatar, name, status (with a colored indicator), species, and creation date
- Scrolling near the bottom loads the next page
- Cached characters show on later launches (even before the network responds)
- On network failure, the user sees an error and can retry
- Reset clears the cache and reloads from page 1
The working implementation lives in a single ViewController.swift.
Refactor this code. Behavior above must stay the same.
Extract a ViewModel (or equivalent): move loading, pagination, caching, and error/retry out of the view controller. ViewController should focus on UI only.
60 minutes
- You can use any tools and libraries (including Google), but no AI-assisted tools
- The app must compile and keep the behavior described above