Multiplatform Migration
Date: 2024-12-09
Summary
Consolidated separate iOS and macOS SPM apps into a single multiplatform Xcode project.
Changes
New Structure
- Created
TimeTracker/directory with XcodeGen-based project - Single codebase with platform conditionals (
#if os(iOS)/#if os(macOS)) - Two schemes:
TimeTracker-iOSandTimeTracker-macOS
Why XcodeGen?
- SPM executable targets don’t support proper iOS app signing
- XcodeGen allows declarative project configuration via
project.yml - Easy to regenerate project:
cd TimeTracker && xcodegen generate
Platform Differences
| Feature | iOS | macOS |
|---|---|---|
| Navigation | TabView | NavigationSplitView |
| Settings | Dedicated tab | Folder button in sidebar |
| New Timer | Sheet | Inline in TodayView |
| Tag creation | Sheet | Inline form |
Shared Components
All these work on both platforms:
TagComboBoxRunningTimerEditorEditableRecordRowPendingDeletionRowRecordRowHistoryView
Deprecated
TimeTrackerMac/- Still works viaswift runbut deprecatedTimeTrackerIOS/- Still works for simulator but deprecated
Testing
# Shared package tests
cd Shared && swift test
# App - open in Xcode and run tests
open TimeTracker/TimeTracker.xcodeproj Related
- 101-overview - Updated architecture
- 910-backlog - Remaining tasks