Skip to content

Latest commit

 

History

History
58 lines (46 loc) · 2.03 KB

File metadata and controls

58 lines (46 loc) · 2.03 KB

Adding Apple Watch Support to zaCalc2

I've created the necessary files for Apple Watch support. To complete the setup, follow these steps in Xcode:

Files Created:

  • zaCalc2-watch Watch App/ - Contains the watchOS app files
  • WatchResultsView.swift - Simplified results view for Apple Watch
  • ContentView.swift - Main watch app view
  • zaCalc2_Watch_AppApp.swift - Watch app entry point
  • CalculatorData.swift - Copy of shared data model
  • Info.plist is auto-generated by Xcode (GENERATE_INFOPLIST_FILE = YES)

Steps to Add watchOS Target in Xcode:

  1. Open the zaCalc2.xcodeproj in Xcode

  2. Add watchOS Target:

    • Select your project in the navigator
    • Click the "+" button to add a new target
    • Choose "watchOS" → "App"
    • Name it "zaCalc2 Watch App"
    • Make sure it's set to use SwiftUI
    • Click "Finish"
  3. Watch App Files:

    • The watch app files are already in the "zaCalc2-watch Watch App" folder
    • These files are automatically configured for the watch target
  4. Configure Target Membership:

    • Select CalculatorData.swift and make sure it's included in both iOS and watchOS targets
    • Make sure all watch app files are only in the watchOS target
  5. Build and Run:

    • Select "zaCalc2 Watch App" scheme
    • Choose your Watch simulator
    • Build and run

Features:

  • Two-page interface optimized for Apple Watch
  • Page-based navigation (swipe or use Digital Crown)
  • Simplified layout with bold variable names on left, values right-aligned
  • Automatically adapts to user's measurement unit preferences

Page 1 - Recipe Results:

  • Total Dough Weight
  • Ball Weight
  • Total Flour
  • Preferment information (for sourdough)
  • Baker's Yeast amount (for baker's yeast)
  • Water, Salt, Oil, Sugar amounts

Page 2 - Toppings:

  • Pizza size and selected style
  • Scaled topping amounts for current pizza size
  • All toppings from the selected pizza style
  • Scaling information (from reference size to actual size)

All values automatically use the same units (grams/ounces) as configured in the iOS app.