iOS "Blaster" App: Press-and-Hold Emoji Projectiles
Problem
Build a minimal iOS app with a button fixed at the bottom. While the user presses and holds the button, the app emits emoji "projectiles" that travel upward at regular intervals until the press ends.
Requirements
-
Interaction
-
A bottom-aligned fire button.
-
Press-and-hold continuously fires projectiles at a fixed interval (e.g., every 80–150 ms).
-
Animation
-
Projectiles animate from the button area toward the top of the screen.
-
Choose and justify an approach: Core Animation, UIKit Dynamics, or SwiftUI.
-
Scheduling
-
Describe how you will schedule continuous firing while the button is held.
-
Cleanup
-
Either implement collision handling or ensure projectiles are cleaned up when off-screen.
-
Performance
-
Discuss performance considerations with many simultaneous projectiles and how to avoid jank.
-
Code Structure & Testability
-
Outline how you would structure the code for unit testing (e.g., timer abstraction, renderer abstraction, separation of UI and logic).
Assume a modern iOS target. You may use UIKit or SwiftUI; include brief code to illustrate your chosen approach and any key abstractions.