Skip to content
gunnargray-devPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Streaks - iOS Streak Tracking App

A minimalist iOS app for tracking daily streaks with a beautiful, intuitive interface built in SwiftUI.

Features

🎯 Core Functionality

  • 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

🎨 User Interface

  • 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

📊 Data Management

  • 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

Project Structure

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

Key Components

StreakManager

The core data management class that handles:

  • Streak history tracking
  • Current streak calculation
  • Yearly data generation
  • View state management

ContentView

The main view that provides:

  • Header with month/year display
  • Current streak counter
  • Toggle between daily and yearly views
  • Interactive streak marking

StreakGridView

A 7x7 grid showing the last 49 days of streak data with:

  • Visual completion indicators
  • Color-coded squares (completed/incomplete)
  • Responsive layout

YearlyStreakView

A yearly calendar view featuring:

  • Month-by-month progress display
  • Year selector
  • Visual day completion indicators
  • Compact monthly grid layout

Usage

Daily View

  • 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

Yearly View

  • 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

Navigation

  • Calendar Button: Toggle between daily and yearly views
  • Double Tap: Quick toggle between views
  • Tap Today: Mark today's streak as complete/incomplete

Technical Details

Requirements

  • iOS 15.0+
  • Xcode 14.0+
  • Swift 5.7+

Architecture

  • SwiftUI: Modern declarative UI framework
  • MVVM Pattern: Clean separation of data and presentation
  • ObservableObject: Reactive data management
  • Local Storage: No external dependencies

Data Models

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
}

Development

Building the Project

  1. Open Streaks.xcodeproj in Xcode
  2. Select your target device or simulator
  3. Build and run the project

Adding Features

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

Customization

  • Modify colors in Assets.xcassets
  • Adjust grid sizes in view components
  • Customize animations in ContentView

Sample Data

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

Future Enhancements

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

License

This project is created for educational and personal use.


Built with ❤️ using SwiftUI

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages