Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Better Sleep

Better Sleep is a SwiftUI breathing timer for iPhone. A session cycles through inhale, hold, and exhale stages, plays distinct transition cues, and can keep the user's choice of white, pink, brown, green, blue, violet, or gray noise playing while the app is in the background. Continuous noise can also be turned off while keeping the breathing cues. The default session length is five minutes.

Open and run

  1. Open BetterSleep.xcodeproj in Xcode.
  2. Select the BetterSleep scheme and an iPhone simulator or device.
  3. Build and run.

The project targets iOS 17 and has no third-party dependencies. Background audio support is declared in BetterSleep/Info.plist.

Repository layout

BetterSleep/
├── BetterSleep.xcodeproj/                 # Xcode project and build settings
├── BetterSleep/
│   ├── App/                               # Application entry point
│   ├── DesignSystem/                      # Shared colors, styles, and backgrounds
│   ├── Features/
│   │   └── Breathing/
│   │       ├── Models/                    # Session configuration and stage types
│   │       ├── Services/                  # Audio engine, noise, and cue generation
│   │       ├── State/                     # Timer and session orchestration
│   │       └── Views/                     # Setup, active, and completion screens
│   ├── Assets.xcassets/                   # App icon and asset catalog
│   └── Info.plist                         # App metadata and background audio mode
└── README.md

The BetterSleep source folder is synchronized with the Xcode target, so Swift files added anywhere inside it are included automatically. Keep documentation, scripts, and other non-app files outside that folder unless they should be bundled into the application target.

Common changes

  • Change default inhale, hold, exhale, or total duration values in BreathingModels.swift.
  • Change timer behavior and stage transitions in BreathingSession.swift.
  • Change noise generation or cue sounds in BreathingAudioService.swift.
  • Change shared colors and button styling in SleepTheme.swift.
  • Change individual screens in the corresponding file under Features/Breathing/Views.

Command-line build

DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer \
  xcodebuild \
  -project BetterSleep.xcodeproj \
  -scheme BetterSleep \
  -sdk iphonesimulator \
  -configuration Debug \
  -derivedDataPath /tmp/BetterSleepDerivedData \
  CODE_SIGNING_ALLOWED=NO \
  build

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages