Refactor update simulation into dedicated file
Done! I've extracted the update simulation code into a dedicated UpdateSimulator.swift file with 7 different scenarios:
.happyPath- Complete successful update flow.notFound- No updates available.error- Error during update check with retry.slowDownload- Slower download for testing progress UI.permissionRequest- Initial permission flow.cancelDuringDownload- User cancels during download.cancelDuringChecking- User cancels during checking
The simulator is now in UpdateSimulator.swift, AppDelegate.swift has been simplified to just call UpdateSimulator.simulate(.happyPath, with: updateViewModel), and I've added a README.md documenting all scenarios.
To try different demos, just change the scenario in AppDelegate.swift line 1010.
Done! I've removed the README and added inline documentation to UpdateSimulator.swift describing each scenario.
Done! I've flattened the structure. Now you use UpdateSimulator.happyPath.simulate(with: updateViewModel) instead of the nested Scenario enum.
Done! All the helper functions are now regular private instance methods instead of static methods.