A sample app showing on screen alarms and user-enabled notifications at given dates/times
For this project, I used a Clean Swift Architecture approach which allows a clear separation between the Presentation (view & view models), Domain (business logic), and Data (endpoint data retrieval and coordination) layers. You'll see lots of protocols at the top of the Data and Domain layers. These allow test object injection when utilized fully.
The main AlarmViewModel kicks off a retrieval use case. The retrieval use case reaches out to the repository for current alarm objects. The repository invokes a service to retrieve the data from the endpoint. The use case converts the response data to models the view expects.
The app provides both an screen notification with sound when an alarm occurs, and, if the user desires, a system notification.
Note: Sound wasn't captured in this video. It works in the app itself.