A minimalist iOS timer app with automatic looping functionality, lock screen integration, and smart persistent state.
- ⭕ Automatic Looping: Timer automatically restarts when it reaches zero
- ⏸️ Play/Pause Controls: Start, pause, and resume the timer
- 🔄 Display Toggle: Switch between time elapsed and time remaining with tap
- ➕➖ Visual Indicators: Always shows +/- sign to indicate elapsed or remaining time
- 🎬 Smart Animations: Numbers animate in the correct direction (up for elapsed, down for remaining)
- 🔔 Chime Sounds: Customizable sounds on loop completion (Bell, Soft Chime)
- 🔒 Lock Screen: Live Activities show timer on lock screen with live updates
- 🌙 Background Operation: Timer continues running when app is backgrounded or screen is locked
- ⚙️ Time Input: Easy picker wheel interface (hours/minutes/seconds)
- 💾 Persistent Settings: Timer duration and display mode are saved across app launches
- 🎨 Smart UI: Timer picker hides when active, replaced with duration text; colors adjust based on state
- 🎯 Minimalist Design: Clean, simple, and focused interface
- Tap to Toggle: Tap the timer display to switch between elapsed and remaining time
- Visual Clarity: Always shows +/- prefix to avoid confusion about elapsed vs remaining time
- State-Based Colors: Timer display dims when idle or paused, vibrant when running
- Contextual Interface: Time picker automatically hides when timer is active, showing duration text instead
- Smooth Transitions: Numbers animate naturally in the correct direction based on counting mode
- Persistent Preferences: All settings (duration, display mode, sound) automatically save
- iOS 17.0 or later
- Xcode 15.0 or later
- Swift 5.9 or later
- Clone or download this repository
- Follow the SETUP_GUIDE.md for detailed Xcode project setup instructions
- Add audio files (see
LoopTimer/Resources/AUDIO_FILES_README.md) - Build and run on your device
LoopTimer/
├── Models/ # Data models (DisplayMode, ChimeSound, TimerState)
├── Services/ # Business logic (Timer, Audio, Live Activities)
├── ViewModels/ # MVVM coordinators (TimerViewModel)
├── Views/ # SwiftUI views (TimerView, TimerDisplayView, etc.)
├── Extensions/ # Helper extensions (TimeInterval, Date)
└── Resources/ # Audio files and assets
LoopTimerWidgetExtension/
└── Live Activity widget implementation
The app follows MVVM (Model-View-ViewModel) architecture with service layer:
- Models: Value types and enums (DisplayMode, ChimeSound, TimerState)
- Services: Core functionality (timer logic, audio, live activities)
- ViewModels: Coordinate services and manage UI state
- Views: SwiftUI views (presentation layer)
- Uses
DispatchSourceTimerfor better background performance - Date-based calculations prevent timer drift
- State restoration survives app termination
AVAudioSessionwith.playbackcategory- Plays even when device is on silent (like alarm apps)
- Automatically routes to headphones/speaker
- AppStorage for user preferences (timer duration, display mode, chime sound)
- UserDefaults for timer state restoration
- Settings persist across app launches
- Minimal setup required
- ActivityKit integration
- Displays on lock screen and Dynamic Island
- Auto-updates with timer progress
See SETUP_GUIDE.md for comprehensive testing checklist including:
- Basic timer functionality
- Audio playback
- Settings persistence
- Background operation
- Live Activities (requires physical device)
This project was built in 5 phases:
- Phase 1: Core timer foundation
- Phase 2: Audio integration
- Phase 3: Settings persistence & state restoration
- Phase 4: Live Activities
- Phase 5: Background operation & UI polish
Each phase was tested before moving to the next, ensuring a solid foundation.
- Live Activities don't work in iOS Simulator (requires physical device)
- Live Activities auto-dismiss after 8 hours (iOS limitation)
- Timer doesn't survive device reboot (expected behavior)
Possible features for future versions:
- UI Updates
- Change UI in different orientations
- Home Screen widget
- Multiple concurrent timers
- Preset timer buttons (30s, 1m, 5m quick start)
- Timer history log with session tracking
- Additional built-in chime sounds
- Custom chime upload
- Apple Watch companion app
This is a personal project, but suggestions and feedback are welcome. Feel free to fork and modify for your own use.
This project is provided as-is for educational and personal use.
Built with:
- SwiftUI
- ActivityKit
- AVFoundation
- DispatchSourceTimer
- Combine
References:
- Apple's Human Interface Guidelines
- Background Execution Best Practices
- Live Activities Documentation
Built with ❤️ using SwiftUI and modern iOS development practices.