A minimalist iOS app for tracking daily streaks with a beautiful, intuitive interface built in SwiftUI.
- Daily Streak Tracking: Track your daily habits with a visual 7x7 grid
- Yearly Calendar View: Switch to a yearly calendar view to see your progress over time
- Current Streak Counter: Prominent display of your current streak count
- Interactive Toggle: Tap to mark today as completed/incomplete
- Smooth Animations: Elegant transitions between daily and yearly views
- Dark/Light Mode: Automatic theme switching based on view mode
- Minimalist Design: Clean, focused interface without distractions
- Responsive Layout: Adapts to different screen sizes
- Visual Feedback: Smooth animations and haptic feedback
- Local Storage: All data stored locally on device
- Sample Data: Includes realistic sample data for demonstration
- Streak Calculation: Automatic calculation of current and longest streaks
Streaks/
├── StreaksApp.swift # Main app entry point
├── ContentView.swift # Main view with streak functionality
├── Models/
│ └── StreakData.swift # Data models and StreakManager
├── Views/
│ ├── StreakGridView.swift # 7x7 daily grid view
│ ├── YearlyStreakView.swift # Yearly calendar view
│ └── PreviewHelper.swift # SwiftUI preview helper
└── Assets.xcassets/ # App icons and colors
The core data management class that handles:
- Streak history tracking
- Current streak calculation
- Yearly data generation
- View state management
The main view that provides:
- Header with month/year display
- Current streak counter
- Toggle between daily and yearly views
- Interactive streak marking
A 7x7 grid showing the last 49 days of streak data with:
- Visual completion indicators
- Color-coded squares (completed/incomplete)
- Responsive layout
A yearly calendar view featuring:
- Month-by-month progress display
- Year selector
- Visual day completion indicators
- Compact monthly grid layout
- View your last 49 days in a 7x7 grid
- Tap to mark today as completed/incomplete
- Double-tap to switch to yearly view
- See your current streak count prominently displayed
- Browse your progress across multiple years
- Select different years to view historical data
- See monthly patterns and trends
- Tap the calendar button to return to daily view
- Calendar Button: Toggle between daily and yearly views
- Double Tap: Quick toggle between views
- Tap Today: Mark today's streak as complete/incomplete
- iOS 15.0+
- Xcode 14.0+
- Swift 5.7+
- SwiftUI: Modern declarative UI framework
- MVVM Pattern: Clean separation of data and presentation
- ObservableObject: Reactive data management
- Local Storage: No external dependencies
struct StreakData {
let date: Date
let completed: Bool
}
struct YearlyStreakData {
let year: Int
let months: [MonthStreakData]
}
struct MonthStreakData {
let month: Int
let days: [DayStreakData]
}
struct DayStreakData {
let day: Int
let completed: Bool
}- Open
Streaks.xcodeprojin Xcode - Select your target device or simulator
- Build and run the project
The modular architecture makes it easy to extend:
- Add new view types in the
Views/directory - Extend data models in
Models/StreakData.swift - Implement persistence in
StreakManager
- Modify colors in
Assets.xcassets - Adjust grid sizes in view components
- Customize animations in
ContentView
The app includes realistic sample data that demonstrates:
- Current year (2023): Good streaks with occasional misses
- Previous year (2022): Mixed performance with improvement over time
- Earlier year (2021): Inconsistent patterns showing progress
Potential features for future versions:
- Data persistence with Core Data
- Multiple habit tracking
- Streak statistics and analytics
- Cloud sync with iCloud
- Widgets for quick streak viewing
- Notifications and reminders
This project is created for educational and personal use.
Built with ❤️ using SwiftUI