A personal habit tracking app for iOS built with SwiftUI and SwiftData.
- Circular Progress Tracking - Visual countdown showing time until your next habit is due
- Flexible Cadence - Set habits for daily, every 2 days, weekly, or custom intervals
- Streak Freezes - Earn freezes at milestones (5, 10, 15...) to protect your streaks
- Grace Period - 24-hour buffer when you miss a habit before losing your streak
- Progress Tracking - View your completion history with habit filtering
- Habit Manual - Built-in guide on habit psychology and best practices
- Interactive Widget - Complete habits directly from your home screen
- Dark Mode - Full support for light and dark appearance
The app features a warm, friendly design with:
- Cream background in light mode, dark grey in dark mode
- Circular progress indicators (green → red → grey)
- Emoji-based habit icons
- Native iOS tab bar navigation
- iOS 17.0+
- Xcode 15.0+
- Swift 5.9+
- macOS with Xcode 15.0+ installed
- iPhone running iOS 17.0+ (iPhone 8 or newer recommended)
- Apple ID for code signing
git clone https://github.com/luis-amrein/Habbit.git
cd Habbit- Double-click
HabitTracker.xcodeprojto open in Xcode - Wait for Xcode to finish indexing and loading dependencies
- Connect your iPhone to your Mac using a USB cable
- On your iPhone, go to Settings → Privacy & Security
- Scroll down to Developer Mode and tap it
- Toggle Developer Mode ON
- Restart your iPhone when prompted
- After restart, confirm Developer Mode is enabled
- On your iPhone, you'll see a "Trust This Computer?" popup
- Tap Trust and enter your passcode if prompted
- Your iPhone should now appear in Xcode's device list
Important: Each developer needs a unique bundle identifier. The default com.luisamrein.HabitTracker may already be taken.
- In Xcode, select the HabitTracker project in the navigator
- Select the HabitTracker target (not the widget)
- Go to the General tab
- Under Identity, change the Bundle Identifier to something unique (e.g.,
com.yourname.HabitTrackerorcom.yourname.Habbit) - Select the HabbitWidgetExtension target
- Change its Bundle Identifier to match (e.g.,
com.yourname.HabitTracker.HabbitWidget)
- With the HabitTracker target selected, go to the Signing & Capabilities tab
- Check Automatically manage signing
- Select your Apple ID from the Team dropdown (or "Add an Account..." if needed)
- Repeat for the HabbitWidgetExtension target
- Xcode will automatically create provisioning profiles for your bundle identifiers
- Select your iPhone from the device dropdown (next to the play button)
- Press
Cmd + Ror click the play button to build and run - The app will install on your iPhone automatically
The interactive widget requires App Groups to share data:
- In Xcode, select the HabitTracker target
- Go to Signing & Capabilities tab
- Click + Capability and add App Groups
- Use group ID:
group.com.yourname.habbit(replaceyournamewith your bundle identifier prefix, e.g., if your bundle ID iscom.john.HabitTracker, usegroup.com.john.habbit) - Repeat for the HabbitWidgetExtension target with the same group ID (must match exactly)
- Important: If you manually edited the entitlements files, ensure both
HabitTracker.entitlementsandHabbitWidgetExtension.entitlementshave the same App Group ID - Add the widget to your home screen: Long press on home screen → + → search for "Habbit"
- Ensure Developer Mode is enabled on iPhone
- Try unplugging and replugging the USB cable
- Restart both Mac and iPhone
- Change the bundle identifier - The default
com.luisamrein.HabitTrackermay already be registered. Use a unique identifier likecom.yourname.HabitTracker - Ensure you're signed into Xcode with your Apple ID (Xcode → Settings → Accounts)
- Ensure Automatically manage signing is checked in Signing & Capabilities
- Try cleaning the project:
Cmd + Shift + K - Delete Derived Data:
Cmd + Shift + Option + K
- This means the bundle identifier is already taken. Change it to something unique:
- Select the HabitTracker target → General tab
- Change Bundle Identifier to
com.yourname.HabitTracker(use your own name/domain) - Select HabbitWidgetExtension target → Change to
com.yourname.HabitTracker.HabbitWidget
- Ensure App Groups capability is added to both targets
- Build and run the main app first, then add the widget
- Restart your iPhone if needed
If Xcode shows disk space errors:
# Clean Xcode cache
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.XcodeHabitTracker/
├── App/
│ ├── HabitTrackerApp.swift # App entry point
│ └── ContentView.swift # Tab navigation
├── Models/
│ ├── Habit.swift # Habit data model with state logic
│ └── HabitCompletion.swift # Completion records
├── Views/
│ ├── HomeView.swift # Main habits screen
│ ├── DashboardView.swift # Analytics & calendar
│ ├── ProfileView.swift # Settings & profile
│ ├── AddEditHabitView.swift # Create/edit habits
│ ├── ManageHabitsView.swift # Reorder & delete habits
│ ├── AboutHabitsView.swift # Habit psychology guide
│ └── AppearanceSettingsView.swift
├── Components/
│ ├── CircularProgressView.swift
│ ├── HabitTileView.swift
│ ├── HabitGridView.swift
│ ├── PillButton.swift
│ └── StreakBadge.swift
├── Extensions/
│ └── Color+Extensions.swift
└── Resources/
└── Assets.xcassets/
HabbitWidget/
├── HabbitWidget.swift # Widget with interactive buttons
├── Assets.xcassets/
└── Info.plist
- On Track (green): Within cadence period
- Grace Period (red): Cadence expired, 24h to complete before streak loss
- Frozen (icy blue): Streak protected by a freeze
- Streak Lost (grey): Grace period expired, streak reset to 0
- Earned at milestones: 5, 10, 15, 20... completions
- Automatically applied when grace period expires (if available)
- Click a frozen habit to unfreeze and continue the streak
- Warm cream background (
#F5F4F1) / Dark mode (#1A1A1A) - White/dark cards with rounded corners
- PT Sans typography
- Green success color (
#39D45C) - Red danger color (
#D4424D) - Icy blue for frozen state (
#ADD8E6)
Personal use only.