Skip to content

agamatlab/rulebook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personal Rulebook - Xcode Project Ready

✅ Complete Setup

All files have been successfully copied to your Xcode project at: /Users/aghamatlabakbarzade/ms/swift/rulebook/rulebook/rulebook/

📁 Project Structure

rulebook/
├── PersonalRulebookApp.swift          # App entry point (@main)
├── Models/
│   └── Rule.swift                      # Core data models
├── ViewModels/
│   └── RulebookViewModel.swift         # State management
├── Views/
│   ├── WelcomeView.swift               # Onboarding screen
│   ├── HomeView.swift                  # Main screen
│   ├── CreateRuleFlow.swift            # 5-step rule creation
│   ├── RuleDetailView.swift            # Individual rule view
│   └── WeeklyReviewView.swift          # Weekly insights
├── Components/
│   ├── RuleCard.swift                  # Reusable rule card
│   └── ReminderPanel.swift             # Intervention UI
├── Utilities/
│   ├── DesignSystem.swift              # Colors, typography, spacing
│   └── MotionSystem.swift              # Animation system
├── Assets.xcassets/
│   ├── AppIcon.appiconset/
│   ├── RulebookIndigo.colorset/        # Primary color #4A548C
│   └── RulebookSage.colorset/          # Secondary color #8CA68C
├── Preview Content/
│   └── Preview Assets.xcassets/
└── Info.plist                          # App configuration

🚀 Open in Xcode

Quick Start

cd /Users/aghamatlabakbarzade/ms/swift/rulebook/rulebook
open rulebook.xcodeproj

Or double-click rulebook.xcodeproj in Finder.

⚙️ Add Files to Xcode Target

The files are copied but need to be added to your Xcode project:

  1. Open the project: open rulebook.xcodeproj

  2. Add all new files:

    • Right-click on "rulebook" folder in Project Navigator
    • Select "Add Files to rulebook..."
    • Navigate to /Users/aghamatlabakbarzade/ms/swift/rulebook/rulebook/rulebook/
    • Select these folders:
      • Models
      • ViewModels
      • Views
      • Components
      • Utilities
    • Also select: PersonalRulebookApp.swift
    • Check "Copy items if needed" (uncheck if already there)
    • Check "Create groups"
    • Ensure "rulebook" target is selected
    • Click "Add"
  3. Update Assets:

    • The color assets are already in place
    • RulebookIndigo and RulebookSage are ready to use
  4. Set Deployment Target:

    • Select project in navigator
    • Under "Deployment Info"
    • Set Minimum Deployments: iOS 15.0

🏃 Run the App

  1. Select a simulator (iPhone 15 Pro recommended)
  2. Press ⌘R or click the Play button
  3. You'll see the Welcome screen!

📱 What You Get

6 Complete Screens

Welcome - Calm onboarding with soft entrance animations
Home - Three sections (Relevant now, All rules, Reflection strip)
Create Rule - 5-step staged flow (Statement → Category → Trigger → If-Then → Why)
Rule Detail - Individual rule view with performance tracking
Reminder Panel - Supportive intervention UI
Weekly Review - Calm metrics with forgiving tone

Design System

  • Colors: Deep Indigo (#4A548C) + Muted Sage (#8CA68C)
  • Typography: SF Pro with semantic sizing
  • Spacing: Generous (xs to xxl scale)
  • Motion: Slow, intentional (0.35-0.8s)
  • Accessibility: Full Reduce Motion support

Features

  • Implementation intentions ("if-then" rules)
  • 5 life categories (Money, Work, Health, Social, Home)
  • Time & context-based triggers
  • Check-in tracking
  • Weekly insights
  • UserDefaults persistence
  • 3 sample rules on first launch

🧪 Quick Test

  1. Launch app → See Welcome screen
  2. Tap "Create first rule"
  3. Enter: "Don't buy tech impulsively"
  4. Select: Money category
  5. Choose: "Before spending" trigger
  6. Fill if-then: "If I want to buy new tech" / "then I wait 48 hours"
  7. Add reason: "To avoid impulse purchases"
  8. Tap "Save Rule"
  9. See rule on Home screen ✨

🐛 Troubleshooting

If Files Don't Appear in Xcode

The files are physically there, but Xcode needs to know about them:

  1. In Xcode, right-click "rulebook" folder
  2. "Add Files to rulebook..."
  3. Select all the new folders (Models, Views, etc.)
  4. Make sure "rulebook" target is checked
  5. Click "Add"

If Build Fails

"Cannot find type 'Rule'":

  • Select each Swift file in Project Navigator
  • Check File Inspector (⌘⌥1)
  • Under "Target Membership", ensure "rulebook" is checked

Clean and rebuild:

  • Product → Clean Build Folder (⌘⇧K)
  • Product → Build (⌘B)

If Colors Don't Show

The colors are already in Assets.xcassets:

  • RulebookIndigo: RGB(74, 84, 140)
  • RulebookSage: RGB(140, 166, 140)

If they don't work, clean and rebuild.

📊 File Count

  • 12 Swift files: Complete implementation
  • 7 Asset files: Colors and icons
  • 1 Info.plist: App configuration
  • Total: Production-ready iOS app

🎯 Design Philosophy

Native - SF Symbols, system fonts, standard patterns
Restrained - No glossy gradients, no cartoon icons
Expensive - Soft materials, generous spacing
Continuous - Zoom transitions, matched geometry
Intentional - Slow motion (0.35-0.8s)
Accessible - Reduce Motion, Dynamic Type, VoiceOver

📚 Documentation

Full guides available:

  • /Users/aghamatlabakbarzade/ms/swift/rulebook/XCODE_SETUP.md
  • /Users/aghamatlabakbarzade/ms/swift/rulebook/docs/README.md
  • /Users/aghamatlabakbarzade/ms/swift/rulebook/docs/IMPLEMENTATION.md

🎨 Next Steps

  1. Open Xcode: open rulebook.xcodeproj
  2. Add files to target (see instructions above)
  3. Run the app: Press ⌘R
  4. Test the flows: Create a rule, view details, check weekly review

You're all set! The app follows your design brief exactly: grounded, structured, decisive. Native iOS design with slow, intentional motion.

About

RuleBook: Daily Habit Tracker - Build better habits and achieve your goals through personalized rules and systematic tracking

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors