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-iOS and TimeTracker-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

FeatureiOSmacOS
NavigationTabViewNavigationSplitView
SettingsDedicated tabFolder button in sidebar
New TimerSheetInline in TodayView
Tag creationSheetInline form

Shared Components

All these work on both platforms:

  • TagComboBox
  • RunningTimerEditor
  • EditableRecordRow
  • PendingDeletionRow
  • RecordRow
  • HistoryView

Deprecated

  • TimeTrackerMac/ - Still works via swift run but deprecated
  • TimeTrackerIOS/ - 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