A beautiful, native multi-platform countdown timer app for Apple's ecosystem with iCloud sync.
- π Multiple Countdown Timers - Create and manage unlimited timers
- β±οΈ Precise Timing - Accurate countdown with second-level precision
- π― Timer Controls - Start, pause, reset, and delete timers
- π± Native UI - Platform-specific SwiftUI interfaces for each device
- πΎ Local Persistence - Timers saved locally using App Groups
- iCloud Sync - Automatically sync timers across all your Apple devices
- CloudKit Integration - Secure, private cloud storage
- Offline Support - Works perfectly without internet, syncs when available
- Conflict Resolution - Smart merging of timers from multiple devices
- πͺ Live Activities - See timer progress on Lock Screen and Dynamic Island (iOS 16.1+)
- π Notifications - Get notified when timers complete
- π² Background Refresh - Timers update in background
- π¨ Modern Design - Beautiful iOS-native interface with progress rings
- π Menu Bar App - Quick access to timers from menu bar
- π₯οΈ Native macOS UI - Designed for desktop experience
- β Full Watch App - Complete timer management on Apple Watch
- π³ Haptic Feedback - Tactile feedback for all actions
- π Standalone - Works independently without iPhone
- π£οΈ Siri Integration - "Hey Siri, start my workout timer"
- β‘ Shortcuts Support - Automate timers with iOS Shortcuts app
- π― App Intents - Create, start, pause, and reset timers via Shortcuts
- SwiftUI - Declarative UI framework for all platforms
- Combine - Reactive programming for state management
- Async/Await - Modern concurrency for CloudKit operations
- CloudKit - Apple's cloud database for cross-device sync
better-timer/
βββ Shared/ # Code shared across all platforms
β βββ Config.swift # Centralized configuration
β βββ TimerModel.swift # Data models
β βββ TimerEngine.swift # Core timer logic
β βββ TimerStore.swift # Persistence & CloudKit sync
β βββ TimerController.swift # Main coordinator
β βββ CloudKitSyncManager.swift # iCloud sync
β βββ NotificationManager.swift # Local notifications
β βββ ...
βββ iOS/ # iOS-specific code
β βββ BetterTimerApp.swift
β βββ TimersListView.swift
β βββ TimerDetailView.swift
β βββ AddTimerView.swift
βββ macOS/ # macOS-specific code
β βββ BetterTimerMacApp.swift
βββ watchOS/ # watchOS-specific code
β βββ BetterTimerWatchApp.swift
β βββ ...
βββ Tests/ # Unit tests
βββ TimerEngineTests.swift
βββ TimerStoreTests.swift
TimerEngine - Thread-safe timer management using DispatchSourceTimer
- Handles countdown logic
- State management (idle, running, paused, completed)
- Tick notifications
TimerStore - Dual-layer persistence
- Local storage via
UserDefaultswith App Groups - Cloud storage via CloudKit for cross-device sync
- Smart merging of local and cloud data
CloudKitSyncManager - iCloud synchronization
- Automatic sync on app launch
- Push changes in background
- Handle remote notifications
- Conflict resolution
TimerController - Main coordinator
- Connects engine, store, and UI
- Manages Live Activities (iOS)
- Schedules notifications
- Handles haptic feedback
- macOS 13.0+ with Xcode 14.0+
- Apple Developer account (for CloudKit and device testing)
- iCloud account for sync features
-
Clone the repository
git clone https://github.com/yourusername/better-timer.git cd better-timer -
Configure identifiers
Open
Shared/Config.swiftand update:static let appGroupIdentifier = "group.com.yourteam.better-timer" static let cloudKitContainerIdentifier = "iCloud.com.yourteam.better-timer" // ... update all identifiers
-
Create Xcode project
See PROJECT_SETUP.md for detailed instructions on:
- Creating Xcode project from source files
- Adding platform targets (iOS, macOS, watchOS)
- Configuring capabilities and signing
-
Set up iCloud sync (optional)
See ICLOUD_SETUP.md for:
- CloudKit container creation
- Capability configuration
- Testing sync across devices
-
Build and run
βB to build βR to run βU to run tests
- iOS/watchOS: Tap the + button
- macOS: Click menu bar icon β Add Timer
- Enter title and duration
- Timer starts in idle state
- Start: Begin countdown
- Pause: Freeze at current time
- Reset: Return to full duration
- Delete: Swipe left (iOS) or context menu
Create shortcuts like:
- "Start my workout timer"
- "Pause all timers"
- "Create a 5-minute break timer"
# In Xcode: Press βU
# Or select: Product β TestTest Coverage:
- Timer countdown logic
- Pause/resume functionality
- Persistence round-trip
- State management
- Create timer with custom name/duration
- Start, pause, resume timer
- Reset timer
- Delete timer
- App restart (persistence)
- Notifications on completion
- Live Activities (iOS)
- iCloud sync across devices
- Offline mode operation
See TestingAndReleaseGuide.md for full checklist.
All identifiers are centralized in Shared/Config.swift:
- App Group identifier
- CloudKit container identifier
- Background task identifier
- Logging subsystems
Disable CloudKit sync for testing:
let store = TimerStore(enableCloudSync: false)Uses os.log unified logging:
Config.logger.info("General app logs")
Config.cloudKitLogger.info("CloudKit operations")
Config.timerLogger.info("Timer engine logs")
Config.notificationLogger.info("Notification logs")View logs in Console.app filtered by subsystem.
- PROJECT_SETUP.md - Detailed Xcode project setup
- ICLOUD_SETUP.md - CloudKit and iCloud configuration
- TestingAndReleaseGuide.md - Testing and release process
- β No force unwraps or unsafe patterns
- β
Proper memory management with
[weak self] - β Thread-safe design
- β Comprehensive error handling and logging
- β Platform-specific compilation directives
- Thread Safety: All timer operations on dedicated serial queue
- Persistence: Dual-layer (local + cloud) for reliability
- Sync Strategy: Cloud takes precedence in conflicts
- State Management: Combine for reactive updates
- UI: SwiftUI for modern, declarative interfaces
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Built with:
- SwiftUI for UI
- Combine for reactive programming
- CloudKit for cloud sync
- ActivityKit for Live Activities
- App Intents for Siri integration
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with β€οΈ using Swift and SwiftUI